public interface Filter
Filter objects can be created by calling
BundleContext.createFilter(java.lang.String) with the chosen filter string.
A Filter object can be used numerous times to determine if the
match argument matches the filter string that was used to create the
Filter object.
Some examples of LDAP filters are:
"(cn=Babs Jensen)"
"(!(cn=Tim Howes))"
"(&(" + Constants.OBJECTCLASS + "=Person)(|(sn=Jensen)(cn=Babs J*)))"
"(o=univ*of*mich*)"
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Compares this
Filter object to another object. |
int |
hashCode()
Returns the hashCode for this
Filter object. |
boolean |
match(java.util.Dictionary dictionary)
Filter using a
Dictionary object. |
boolean |
match(ServiceReference reference)
Filter using a service's properties.
|
boolean |
matchCase(java.util.Dictionary dictionary)
Filter with case sensitivity using a
Dictionary object. |
java.lang.String |
toString()
Returns this
Filter object's filter string. |
boolean match(ServiceReference reference)
The filter is executed using the keys and values of the referenced service's properties. The keys are case insensitively matched with the filter.
reference - The reference to the service whose properties are used
in the match.true if the service's properties match this
filter; false otherwise.boolean match(java.util.Dictionary dictionary)
Dictionary object. The Filter is executed
using the Dictionary object's keys and values. The keys
are case insensitively matched with the filter.dictionary - The Dictionary object whose keys are
used in the match.true if the Dictionary object's
keys and values match this filter; false
otherwise.java.lang.IllegalArgumentException - If dictionary contains
case variants of the same key name.java.lang.String toString()
Filter object's filter string.
The filter string is normalized by removing whitespace which does not affect the meaning of the filter.
toString in class java.lang.Objectboolean equals(java.lang.Object obj)
Filter object to another object.equals in class java.lang.Objectobj - The object to compare against this Filter
object.Filter object, then
returns this.toString().equals(obj.toString();false
otherwise.int hashCode()
Filter object.hashCode in class java.lang.Objectthis.toString().hashCode().boolean matchCase(java.util.Dictionary dictionary)
Dictionary object.
The Filter is executed using the Dictionary object's keys
and values. The keys are case sensitively matched with the filter.dictionary - The Dictionary object whose keys are
used in the match.true if the Dictionary object's
keys and values match this filter; false
otherwise.