Class ProjectFilter

java.lang.Object
net.sf.basedb.core.snapshot.ProjectFilter
All Implemented Interfaces:
Filter<AnnotationSnapshot>

public class ProjectFilter
extends Object
implements Filter<AnnotationSnapshot>
Filter implementation that finds all annotation snapshots for a given set of projects. Intended to be used with SnapshotManager.findAnnotations(DbControl, AnnotationSetSnapshot, Filter, boolean) when the manager is in the "all projects" mode. In other modes, the snapshot manager will select only the default values, or project-specific values for the currently active project. See SnapshotManager.setAllProjects(), SnapshotManager.setProject(Project) and SnapshotManager.setNoProject().
Version:
3.19.4
Author:
Nicklas
Last modified
$Date$
  • Field Details

  • Constructor Details

    • ProjectFilter

      public ProjectFilter​(DbControl dc)
      Create a filter that matches all projects that the current user has access to including the default values.
    • ProjectFilter

      public ProjectFilter​(Collection<Project> projects, boolean includeDefaultValues)
      Create a filter that matches the given projects and optionally default values.
    • ProjectFilter

      public ProjectFilter​(Collection<Integer> projects)
      Create a filter that matches the given projects ID values. To match default values make sure that '0' is included in the given values.
  • Method Details

    • evaluate

      public boolean evaluate​(AnnotationSnapshot snapshot)
      Description copied from interface: Filter
      Evaluate if the given object should pass the filter or not.
      Specified by:
      evaluate in interface Filter<AnnotationSnapshot>
      Parameters:
      snapshot - The object to evaluate
      Returns:
      TRUE if the object passes the filter, FALSE otherwise