Interface Filter
public interface Filter
An RFC 1960-based Filter.
Filters can be created by calling
BundleContext.createFilter(String) or FrameworkUtil.createFilter(String) with
a filter string.
A Filter can be used numerous times to determine if the match
argument matches the filter string that was used to create the
Filter.
Some examples of LDAP filters are:
"(cn=Babs Jensen)"
"(!(cn=Tim Howes))"
"(&(" + Constants.OBJECTCLASS + "=Person)(|(sn=Jensen)(cn=Babs J*)))"
"(o=univ*of*mich*)"
- Since:
- 1.1
- Version:
- $Revision: 6860 $
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares thisFilterto anotherFilter.inthashCode()Returns the hashCode for thisFilter.booleanmatch(Dictionary dictionary) Filter using aDictionary.booleanmatch(ServiceReference reference) Filter using a service's properties.booleanmatchCase(Dictionary dictionary) Filter with case sensitivity using aDictionary.toString()Returns thisFilter's filter string.
-
Method Details
-
match
Filter using a service's properties.This
Filteris executed using the keys and values of the referenced service's properties. The keys are case insensitively matched with thisFilter.- Parameters:
reference- The reference to the service whose properties are used in the match.- Returns:
trueif the service's properties match thisFilter;falseotherwise.
-
match
Filter using aDictionary. ThisFilteris executed using the specifiedDictionary's keys and values. The keys are case insensitively matched with thisFilter.- Parameters:
dictionary- TheDictionarywhose keys are used in the match.- Returns:
trueif theDictionary's keys and values match this filter;falseotherwise.- Throws:
IllegalArgumentException- Ifdictionarycontains case variants of the same key name.
-
toString
-
equals
Compares thisFilterto anotherFilter.This method returns the result of calling
this.toString().equals(obj.toString()). -
hashCode
-
matchCase
Filter with case sensitivity using aDictionary. ThisFilteris executed using the specifiedDictionary's keys and values. The keys are case sensitively matched with thisFilter.- Parameters:
dictionary- TheDictionarywhose keys are used in the match.- Returns:
trueif theDictionary's keys and values match this filter;falseotherwise.- Since:
- 1.3
-