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
ConstructorDescriptionCompareFilter
(String attribute, int value) Convenience constructor forint
values.CompareFilter
(String attribute, String value) -
Method Summary
Modifier and TypeMethodDescriptionencode
(StringBuffer buff) Encodes the filter to a StringBuffer.protected String
encodeValue
(String value) Override to perform special encoding in subclass.boolean
All filters must implement equals.protected abstract String
Implement this method in subclass to return a String representing the operator.int
hashCode()
All filters must implement hashCode.Methods inherited from class org.springframework.ldap.filter.AbstractFilter
encode, toString
-
Constructor Details
-
CompareFilter
-
CompareFilter
Convenience constructor forint
values.- 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:Filter
Encodes 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:Filter
All filters must implement equals. -
hashCode
public int hashCode()Description copied from interface:Filter
All filters must implement hashCode.- Specified by:
hashCode
in interfaceFilter
- Overrides:
hashCode
in 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.
-