接口 Filter
-
- 所有已知实现类:
FilterImpl
@ProviderType public interface FilterAn RFC 1960-based Filter.Filters can be created by callingBundleContext.createFilter(String)orFrameworkUtil.createFilter(String)with a filter string.A
Filtercan be used numerous times to determine if the match argument matches the filter string that was used to create theFilter.Some examples of LDAP filters are:
"(cn=Babs Jensen)" "(!(cn=Tim Howes))" "(&(" + Constants.OBJECTCLASS + "=Person)(|(sn=Jensen)(cn=Babs J*)))" "(o=univ*of*mich*)"- 从以下版本开始:
- 1.1
- 作者:
- $Id: 58cd4db16892b20e44be1288ccac929a5a26c53a $
- 另请参阅:
- "Core Specification, Filters, for a description of the filter string syntax."
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 booleanequals(java.lang.Object obj)Compares thisFilterto anotherFilter.inthashCode()Returns the hashCode for thisFilter.booleanmatch(java.util.Dictionary<java.lang.String,?> dictionary)Filter using aDictionarywith case insensitive key lookup.booleanmatch(ServiceReference<?> reference)Filter using a service's properties.booleanmatchCase(java.util.Dictionary<java.lang.String,?> dictionary)Filter using aDictionary.booleanmatches(java.util.Map<java.lang.String,?> map)Filter using aMap.java.lang.StringtoString()Returns thisFilter's filter string.
-
-
-
方法详细资料
-
match
boolean match(ServiceReference<?> reference)
Filter using a service's properties.This
Filteris executed using the keys and values of the referenced service's properties. The keys are looked up in a case insensitive manner.- 参数:
reference- The reference to the service whose properties are used in the match.- 返回:
trueif the service's properties match thisFilter;falseotherwise.
-
match
boolean match(java.util.Dictionary<java.lang.String,?> dictionary)
Filter using aDictionarywith case insensitive key lookup. ThisFilteris executed using the specifiedDictionary's keys and values. The keys are looked up in a case insensitive manner.- 参数:
dictionary- TheDictionarywhose key/value pairs are used in the match.- 返回:
trueif theDictionary's values match this filter;falseotherwise.- 抛出:
java.lang.IllegalArgumentException- Ifdictionarycontains case variants of the same key name.
-
toString
java.lang.String toString()
Returns thisFilter's filter string.The filter string is normalized by removing whitespace which does not affect the meaning of the filter.
- 覆盖:
toString在类中java.lang.Object- 返回:
- This
Filter's filter string.
-
equals
boolean equals(java.lang.Object obj)
Compares thisFilterto anotherFilter.This implementation returns the result of calling
this.toString().equals(obj.toString()).- 覆盖:
equals在类中java.lang.Object- 参数:
obj- The object to compare against thisFilter.- 返回:
- If the other object is a
Filterobject, then returns the result of callingthis.toString().equals(obj.toString());falseotherwise.
-
hashCode
int hashCode()
Returns the hashCode for thisFilter.This implementation returns the result of calling
this.toString().hashCode().- 覆盖:
hashCode在类中java.lang.Object- 返回:
- The hashCode of this
Filter.
-
matchCase
boolean matchCase(java.util.Dictionary<java.lang.String,?> dictionary)
Filter using aDictionary. ThisFilteris executed using the specifiedDictionary's keys and values. The keys are looked up in a normal manner respecting case.- 参数:
dictionary- TheDictionarywhose key/value pairs are used in the match.- 返回:
trueif theDictionary's values match this filter;falseotherwise.- 从以下版本开始:
- 1.3
-
matches
boolean matches(java.util.Map<java.lang.String,?> map)
Filter using aMap. ThisFilteris executed using the specifiedMap's keys and values. The keys are looked up in a normal manner respecting case.- 参数:
map- TheMapwhose key/value pairs are used in the match. Maps withnullkey or values are not supported. Anullvalue is considered not present to the filter.- 返回:
trueif theMap's values match this filter;falseotherwise.- 从以下版本开始:
- 1.6
-
-