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
public abstract class CompareFilter extends AbstractFilter
Abstract superclass for filters that compare values.
-
-
Constructor Summary
Constructors Constructor Description CompareFilter(java.lang.String attribute, int value)Convenience constructor forintvalues.CompareFilter(java.lang.String attribute, java.lang.String value)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.StringBufferencode(java.lang.StringBuffer buff)Encodes the filter to a StringBuffer.protected java.lang.StringencodeValue(java.lang.String value)Override to perform special encoding in subclass.booleanequals(java.lang.Object o)All filters must implement equals.protected abstract java.lang.StringgetCompareString()Implement 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 Detail
-
CompareFilter
public CompareFilter(java.lang.String attribute, java.lang.String value)
-
CompareFilter
public CompareFilter(java.lang.String attribute, int value)Convenience constructor forintvalues.- Parameters:
attribute- Name of attribute in filter.value- The value of the attribute in the filter.
-
-
Method Detail
-
encodeValue
protected java.lang.String encodeValue(java.lang.String value)
Override to perform special encoding in subclass.- Parameters:
value- the value to encode.- Returns:
- properly escaped value.
-
encode
public java.lang.StringBuffer encode(java.lang.StringBuffer buff)
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
public boolean equals(java.lang.Object o)
Description copied from interface:FilterAll filters must implement equals.
-
hashCode
public int hashCode()
Description copied from interface:FilterAll filters must implement hashCode.
-
getCompareString
protected abstract java.lang.String 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.
-
-