Spring LDAP Framework

org.springframework.ldap.filter
Class NotPresentFilter

java.lang.Object
  extended by org.springframework.ldap.filter.AbstractFilter
      extended by org.springframework.ldap.filter.NotPresentFilter
All Implemented Interfaces:
Filter

public class NotPresentFilter
extends AbstractFilter

A convenience class that combines NOT behavior with present behavior to allow the user to check for the non-existence of a attribute. For an attribute to be NOT present it must not have any values set. To filter on attributes at are present use the PresentFilter.

 NotPresentFilter filter = new NotPresentFilter("foo");
 System.out.println(filter.encode());
 
would result in:
  (!(foo=*))
 

Author:
Jordan Hein

Constructor Summary
NotPresentFilter(String attribute)
          Creates a new instance of a not present filter for a particular attribute.
 
Method Summary
 StringBuffer encode(StringBuffer buff)
          Encodes the filter to a StringBuffer.
 boolean equals(Object o)
          All filters must implement equals.
 int hashCode()
          All filters must implement hashCode.
 
Methods inherited from class org.springframework.ldap.filter.AbstractFilter
encode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NotPresentFilter

public NotPresentFilter(String attribute)
Creates a new instance of a not present filter for a particular attribute.

Parameters:
attribute - the attribute expected to be not-present (ie, unset, or null).
Method Detail

encode

public StringBuffer encode(StringBuffer buff)
Description copied from interface: Filter
Encodes the filter to a StringBuffer.

Specified by:
encode in interface Filter
Specified by:
encode in class AbstractFilter
Parameters:
buff - The StringBuffer to encode the filter to
Returns:
The same StringBuffer as was given

equals

public boolean equals(Object o)
Description copied from interface: Filter
All filters must implement equals.

Specified by:
equals in interface Filter
Overrides:
equals in class 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 Object
Returns:
the hash code according to the contract in Object.hashCode()

Spring LDAP Framework

Copyright © 2005-2010 The Spring LDAP Framework. All Rights Reserved.