Class EqualsFilter

All Implemented Interfaces:
Filter
Direct Known Subclasses:
LikeFilter, WhitespaceWildcardsFilter

public class EqualsFilter extends CompareFilter
A filter for 'equals'. The following code:
 EqualsFilter filter = new EqualsFilter("cn", "Some CN");
 System.out.println(filter.encode());
 
would result in:
 (cn=Some CN)
 
  • Constructor Details

    • EqualsFilter

      public EqualsFilter(String attribute, String value)
    • EqualsFilter

      public EqualsFilter(String attribute, int value)
      Convenience constructor for int values.
      Parameters:
      attribute - Name of attribute in filter.
      value - The value of the attribute in the filter.
  • Method Details

    • getCompareString

      protected String getCompareString()
      Description copied from class: CompareFilter
      Implement this method in subclass to return a String representing the operator. The getCompareString() would for example return an equals sign, "=".
      Specified by:
      getCompareString in class CompareFilter
      Returns:
      the String to use as operator in the comparison for the specific subclass.