Class FilterByProperty

  • All Implemented Interfaces:
    FilterBy

    public class FilterByProperty
    extends Object
    implements FilterBy
    Filters resources by a given property. The filter only matches if the attribute exists and has the exact given value.
    Author:
    Roland Gruber
    • Constructor Detail

      • FilterByProperty

        public FilterByProperty​(@Nonnull
                                String name,
                                Object value)
        Constructor
        Parameters:
        name - attribute name
        value - attribute value
    • Method Detail

      • filter

        public boolean filter​(@Nonnull
                              org.apache.sling.api.resource.Resource resource,
                              StringBuilder output)
        Description copied from interface: FilterBy
        Checks if the given resource matches the filter criteria.
        Specified by:
        filter in interface FilterBy
        Parameters:
        resource - resource
        output - output buffer
        Returns:
        matches