Package org.springframework.ldap.filter
Class CompareFilter
java.lang.Object
org.springframework.ldap.filter.AbstractFilter
org.springframework.ldap.filter.CompareFilter
- All Implemented Interfaces:
Filter
- Direct Known Subclasses:
EqualsFilter,GreaterThanOrEqualsFilter,LessThanOrEqualsFilter
Abstract superclass for filters that compare values.
-
Constructor Summary
ConstructorsConstructorDescriptionCompareFilter(String attribute, int value) Convenience constructor forintvalues.CompareFilter(String attribute, String value) -
Method Summary
Modifier and TypeMethodDescriptionencode(StringBuffer buff) Encodes the filter to a StringBuffer.protected StringencodeValue(String value) Override to perform special encoding in subclass.booleanAll filters must implement equals.protected abstract StringImplement this method in subclass to return a String representing the operator.inthashCode()All filters must implement hashCode.Methods inherited from class org.springframework.ldap.filter.AbstractFilter
encode, toString
-
Constructor Details
-
CompareFilter
-
CompareFilter
Convenience constructor forintvalues.- Parameters:
attribute- Name of attribute in filter.value- The value of the attribute in the filter.
-
-
Method Details
-
encodeValue
Override to perform special encoding in subclass.- Parameters:
value- the value to encode.- Returns:
- properly escaped value.
-
encode
Description copied from interface:FilterEncodes the filter to a StringBuffer.- Parameters:
buff- The StringBuffer to encode the filter to- Returns:
- The same StringBuffer as was given
-
equals
Description copied from interface:FilterAll filters must implement equals. -
hashCode
public int hashCode()Description copied from interface:FilterAll filters must implement hashCode.- Specified by:
hashCodein interfaceFilter- Overrides:
hashCodein classObject- Returns:
- the hash code according to the contract in
Object.hashCode()
-
getCompareString
Implement this method in subclass to return a String representing the operator. TheEqualsFilter.getCompareString()would for example return an equals sign, "=".- Returns:
- the String to use as operator in the comparison for the specific subclass.
-