public final class MatchingRule extends Object
Matching rule implementations must extend the
MatchingRuleImplementation
class so they can be used by OpenDJ.
Where ordered sets of names, or extra properties are provided, the ordering
will be preserved when the associated fields are accessed via their getters
or via the toString()
methods.
Modifier and Type | Class and Description |
---|---|
static class |
MatchingRule.Builder
A fluent API for incrementally constructing matching rules.
|
Modifier and Type | Method and Description |
---|---|
Collection<? extends Indexer> |
createIndexers(IndexingOptions options)
Returns the indexers for this matching rule configured using the provided indexing options.
|
boolean |
equals(Object o)
Returns
true if the provided object is a matching rule having the
same numeric OID as this matching rule. |
Assertion |
getAssertion(ByteSequence value)
Returns the normalized form of the provided assertion value, which is
best suited for efficiently performing matching operations on that value.
|
String |
getDescription()
Returns the description of this schema element, or the empty string if it does not have a description.
|
Map<String,List<String>> |
getExtraProperties()
Returns an unmodifiable map containing all of the extra properties associated with this schema element.
|
Assertion |
getGreaterOrEqualAssertion(ByteSequence value)
Returns the normalized form of the provided assertion value, which is
best suited for efficiently performing greater than or equal ordering
matching operations on that value.
|
Assertion |
getLessOrEqualAssertion(ByteSequence value)
Returns the normalized form of the provided assertion value, which is
best suited for efficiently performing greater than or equal ordering
matching operations on that value.
|
String |
getNameOrOid()
Returns the name or OID for this schema definition.
|
List<String> |
getNames()
Returns an unmodifiable list containing the user-defined names that may
be used to reference this schema definition.
|
String |
getOid()
Returns the OID for this schema definition.
|
Assertion |
getSubstringAssertion(ByteSequence subInitial,
List<? extends ByteSequence> subAnyElements,
ByteSequence subFinal)
Returns the normalized form of the provided assertion substring values,
which is best suited for efficiently performing matching operations on
that value.
|
Syntax |
getSyntax()
Returns the OID of the assertion value syntax with which this matching
rule is associated.
|
int |
hashCode()
Returns the hash code for this matching rule.
|
boolean |
hasName(String name)
Indicates whether this schema definition has the specified name.
|
boolean |
hasNameOrOid(String value)
Indicates whether this schema definition has the specified name or OID.
|
boolean |
isObsolete()
Indicates whether this schema definition is declared "obsolete".
|
ByteString |
normalizeAttributeValue(ByteSequence value)
Returns the normalized form of the provided attribute value, which is
best suited for efficiently performing matching operations on that value.
|
String |
toString()
Returns the string representation of this schema element as defined in
RFC 2252.
|
public boolean equals(Object o)
true
if the provided object is a matching rule having the
same numeric OID as this matching rule.o
- The object to be compared.true
if the provided object is a matching rule having the
same numeric OID as this matching rule.public Assertion getAssertion(ByteSequence value) throws DecodeException
value
- The syntax checked assertion value to be normalized.DecodeException
- if the syntax of the value is not valid.public Assertion getSubstringAssertion(ByteSequence subInitial, List<? extends ByteSequence> subAnyElements, ByteSequence subFinal) throws DecodeException
subInitial
- The normalized substring value fragment that should appear at
the beginning of the target value.subAnyElements
- The normalized substring value fragments that should appear in
the middle of the target value.subFinal
- The normalized substring value fragment that should appear at
the end of the target value.DecodeException
- if the syntax of the value is not valid.public Assertion getGreaterOrEqualAssertion(ByteSequence value) throws DecodeException
value
- The syntax checked assertion value to be normalized.DecodeException
- if the syntax of the value is not valid.public Assertion getLessOrEqualAssertion(ByteSequence value) throws DecodeException
value
- The syntax checked assertion value to be normalized.DecodeException
- if the syntax of the value is not valid.public Collection<? extends Indexer> createIndexers(IndexingOptions options)
options
- The indexing optionspublic String getNameOrOid()
public List<String> getNames()
public String getOid()
public Syntax getSyntax()
public int hashCode()
public boolean hasName(String name)
name
- The name for which to make the determination.true
if the specified name is assigned to this
schema definition, or false
if not.public boolean hasNameOrOid(String value)
value
- The value for which to make the determination.true
if the provided value matches the OID or one of
the names assigned to this schema definition, or
false
if not.public boolean isObsolete()
true
if this schema definition is declared
"obsolete", or false
if not.public ByteString normalizeAttributeValue(ByteSequence value) throws DecodeException
ByteSequence.equals(Object)
. In addition, normalized values can
be compared using ByteSequence.compareTo(ByteSequence)
, although
the sort order is only defined for ordering matching rules.value
- The attribute value to be normalized.DecodeException
- If the syntax of the value is not valid.public final String getDescription()
SchemaElement
getDescription
in interface SchemaElement
public final Map<String,List<String>> getExtraProperties()
SchemaElement
getExtraProperties
in interface SchemaElement
Copyright 2010-2022 ForgeRock AS.