Class PresentFilter

  • All Implemented Interfaces:
    Filter

    public class PresentFilter
    extends AbstractFilter
    Filter that allows the user to check for the existence of a attribute. For an attribute to be 'present' it must contain a value. Attributes that do not contain a value are 'NOT present'. To filter on attributes that are 'NOT present' use the NotPresentFilter or use this filter in combination with a NotFilter .
     PresentFilter filter = new PresentFilter("foo");
     System.out.println(filter.encode());
     
    would result in:
      (foo=*)
     
    • Constructor Summary

      Constructors 
      Constructor Description
      PresentFilter​(java.lang.String attribute)
      Creates a new instance of a present filter for a particular attribute.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.StringBuffer encode​(java.lang.StringBuffer buff)
      Encodes the filter to a StringBuffer.
      boolean equals​(java.lang.Object o)
      All filters must implement equals.
      int hashCode()
      All filters must implement hashCode.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PresentFilter

        public PresentFilter​(java.lang.String attribute)
        Creates a new instance of a present filter for a particular attribute.
        Parameters:
        attribute - the attribute expected to be present (ie, contains a value).
    • Method Detail

      • encode

        public java.lang.StringBuffer encode​(java.lang.StringBuffer buff)
        Description copied from interface: Filter
        Encodes the filter to a StringBuffer.
        Parameters:
        buff - The StringBuffer to encode the filter to
        Returns:
        The same StringBuffer as was given
      • equals

        public boolean equals​(java.lang.Object o)
        Description copied from interface: Filter
        All filters must implement equals.
        Specified by:
        equals in interface Filter
        Overrides:
        equals in class java.lang.Object
        Returns:
        true if the objects are equal.
      • hashCode

        public int hashCode()
        Description copied from interface: Filter
        All filters must implement hashCode.
        Specified by:
        hashCode in interface Filter
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hash code according to the contract in Object.hashCode()