Class DefaultConfigurationSearchFilter

  • All Implemented Interfaces:
    ConfigurationSearchFilter

    public class DefaultConfigurationSearchFilter
    extends java.lang.Object
    implements ConfigurationSearchFilter
    Default implementation of search filter.

    Filter gathers all possible values for different attributes and checks if provided value matches any of them if requested.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addPossibleValues​(java.lang.String attribute, java.util.Collection<java.lang.String> values)
      Adds possible values for a single attribute.
      void addPossibleValues​(java.util.Map<java.lang.String,​? extends java.util.Collection<java.lang.String>> values)
      Adds possible values for different attributes.
      boolean filter​(java.lang.String name, java.lang.String value)
      Checks whether there is a need of executing particular search.
      java.util.Collection<java.lang.String> getPossibleValues​(java.lang.String attribute)
      Gets all defined possible values for specified attribute.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultConfigurationSearchFilter

        public DefaultConfigurationSearchFilter​(ContextAttributeComparator comparator)
        Parameters:
        comparator - comparator used to check whether provided value matches any of possible
    • Method Detail

      • addPossibleValues

        public void addPossibleValues​(java.util.Map<java.lang.String,​? extends java.util.Collection<java.lang.String>> values)
        Adds possible values for different attributes.
        Parameters:
        values - map of possible values in convention <attribute name, collection of values>
      • addPossibleValues

        public void addPossibleValues​(java.lang.String attribute,
                                      java.util.Collection<java.lang.String> values)
        Adds possible values for a single attribute.
        Parameters:
        attribute - attribute name
        values - possible values
      • getPossibleValues

        public java.util.Collection<java.lang.String> getPossibleValues​(java.lang.String attribute)
        Gets all defined possible values for specified attribute.
        Parameters:
        attribute - attribute name
        Returns:
        collection of possible values for attribute
      • filter

        public boolean filter​(java.lang.String name,
                              java.lang.String value)
        Description copied from interface: ConfigurationSearchFilter
        Checks whether there is a need of executing particular search.
        Specified by:
        filter in interface ConfigurationSearchFilter
        Parameters:
        name - name of attribute that is about to change
        value - new value of attribute
        Returns:
        true if this search may be omitted, false otherwise