Package org.forgerock.opendj.ldap
Class Matcher
java.lang.Object
org.forgerock.opendj.ldap.Matcher
A compiled search
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()
.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionboolean
This method returnstrue
when two filters are equivalent.Returns the assertion for this comparison filter matcher.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.Returns the type of this filterMatcher
.Returns the sub-matcher for this NOT filter matcher.Returns an unmodifiable list containing the sub-matchers for this AND or OR filter matcher.Returns the diagnostic reasons for this undefined filter matcher.int
hashCode()
This method returns the same hash-code for any two equivalent filters.boolean
Returns whether extensible matching should be performed against attributes in an entry's DN.Indicates whether this filterMatcher
matches the providedEntry
.toString()
-
Method Details
-
equals
This method returnstrue
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. -
hashCode
public int hashCode()This method returns the same hash-code for any two equivalent filters. 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. -
getMatcherType
Returns the type of this filterMatcher
.- Returns:
- the type of this filter
Matcher
-
getSubMatchers
Returns an unmodifiable list containing the sub-matchers for this AND or OR filter matcher.- Returns:
- an unmodifiable list containing the sub-matchers for this AND or OR filter matcher
- Throws:
UnsupportedOperationException
- If this filterMatcher
is not an AND or OR filter.
-
getNotSubMatcher
Returns the sub-matcher for this NOT filter matcher.- Returns:
- the sub-matcher for this NOT filter matcher
- Throws:
UnsupportedOperationException
- If this filterMatcher
is not a NOT filter.
-
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..- 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
- Throws:
UnsupportedOperationException
- If this filterMatcher
is not an equality, greater than, less than, approximate, presence, substrings, or extensible match filter.
-
getAssertion
Returns the assertion for this comparison filter matcher.- Returns:
- the assertion for this comparison filter matcher
- Throws:
UnsupportedOperationException
- If this filterMatcher
is not an equality, greater than, less than, approximate, or extensible match filter.
-
getUndefinedReason
Returns the diagnostic reasons for this undefined filter matcher.- Returns:
- the diagnostic reasons for this undefined filter matcher
- Throws:
UnsupportedOperationException
- If this filterMatcher
is not an undefined match filter.
-
isDnAttributes
public boolean isDnAttributes()Returns whether extensible matching should be performed against attributes in an entry's DN.- Returns:
- whether extensible matching should be performed against attributes in an entry's DN
- Throws:
UnsupportedOperationException
- If this filterMatcher
is not an extensible match filter.
-
matches
Indicates whether this filterMatcher
matches the providedEntry
.- Parameters:
entry
- The entry to be matched.- Returns:
- The result of matching the provided
Entry
against this filterMatcher
.
-
toString
-