Class FacetFilter

java.lang.Object
org.nuxeo.ecm.core.api.impl.FacetFilter
All Implemented Interfaces:
Filter

public class FacetFilter extends Object implements Filter
A filter based on facets.
Author:
Georges Racinet, Florent Guillaume
  • Field Details

    • ALLOW

      public static final FacetFilter ALLOW
    • required

      public final Set<String> required
      Set of required facets. Never null.
    • excluded

      public final Set<String> excluded
      Set of excluded facets. Never null.
    • shortcut

      public final Boolean shortcut
  • Constructor Details

    • FacetFilter

      public FacetFilter(List<String> required, List<String> excluded)
      Generic constructor.
      Parameters:
      required - list of facets the models must have to pass the filter
      excluded - list of facets the models must not have to pass the filter
    • FacetFilter

      public FacetFilter(String facet, boolean isRequired)
      Simpler constructor to filter on a single facet.
      Parameters:
      facet - the facet to filter on
      isRequired - if true, accepted models must have the facet; if false, accepted models must not have the facet
    • FacetFilter

      public FacetFilter(FacetFilter filter1, FacetFilter filter2)
      Constructor that ANDs two filters.
      Parameters:
      filter1 - the first filter
      filter2 - the second filter
  • Method Details

    • findShortcut

      protected Boolean findShortcut()
    • accept

      public boolean accept(DocumentModel docModel)
      Description copied from interface: Filter
      Filters data models objects.
      Specified by:
      accept in interface Filter
      Returns:
      true if accepting the object false otherwise