public final class Matcher extends Object
Filter
which may be used for matching
against entries.
Compilation
may produce an optimized matcher having a different structure to the original
filter. In particular, filter components may be simplified, removed, or re-ordered. Equivalent matchers compare
equal using equals(Object)
and produce the same hashCode()
.
Modifier and Type | Class and Description |
---|---|
static class |
Matcher.MatcherType
The types of compiled matcher.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
This method returns
true when two filters are equivalent. |
Assertion |
getAssertion()
Returns the assertion for this comparison filter
Matcher . |
AttributeDescription |
getAttributeDescription()
Returns the attribute description for this comparison filter
Matcher , which may be null if the
filter is an extensible match filter specifying an extensible matching rule. |
Filter |
getFilter()
Returns the raw
Filter associated with this comparison or undefined filter Matcher . |
Matcher.MatcherType |
getMatcherType()
Returns the type of this filter
Matcher . |
Matcher |
getNotSubMatcher()
Returns the sub-matcher for this NOT filter
Matcher . |
List<Matcher> |
getSubMatchers()
Returns an unmodifiable list containing the sub-matchers for this AND or OR filter
Matcher . |
int |
hashCode()
This method returns the same hash-code for any two equivalent filters.
|
ConditionResult |
matches(Entry entry)
Indicates whether this filter
Matcher matches the provided Entry . |
String |
toString() |
public boolean equals(Object obj)
true
when two filters are equivalent. In particular, the attribute descriptions
"cn" and "commonName" will be treated the same, as will AND/OR filters containing the same sub-filters
regardless of their order.public int hashCode()
public Matcher.MatcherType getMatcherType()
Matcher
.Matcher
.public Filter getFilter()
Filter
associated with this comparison or undefined filter Matcher
.Filter
associated with this comparison or undefined filter Matcher
.UnsupportedOperationException
- If this filter Matcher
is not an equality, greater than, less than, approximate, presence,
substrings, extensible or undefined filter.public List<Matcher> getSubMatchers()
Matcher
.Matcher
.UnsupportedOperationException
- If this filter Matcher
is not an AND or OR filter.public Matcher getNotSubMatcher()
Matcher
.Matcher
.UnsupportedOperationException
- If this filter Matcher
is not a NOT filter.public AttributeDescription getAttributeDescription()
Matcher
, which may be null
if the
filter is an extensible match filter specifying an extensible matching rule.Matcher
, which may be null
if the
filter is an extensible match filter.UnsupportedOperationException
- If this filter Matcher
is not an equality, greater than, less than, approximate, presence,
substrings, or extensible match filter.public Assertion getAssertion()
Matcher
.Matcher
.UnsupportedOperationException
- If this filter Matcher
is not an equality, greater than, less than, approximate, or extensible
match filter.public ConditionResult matches(Entry entry)
Matcher
matches the provided Entry
.entry
- The entry to be matched.Entry
against this filter Matcher
.Copyright 2010-2022 ForgeRock AS.