Package com.unboundid.ldap.sdk.controls
Class MatchedValuesFilter
java.lang.Object
com.unboundid.ldap.sdk.controls.MatchedValuesFilter
- All Implemented Interfaces:
Serializable
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class MatchedValuesFilter
extends Object
implements Serializable
This class provides an implementation of the simple filter item for use with
the
MatchedValuesRequestControl as defined in
RFC 3876. It is similar to
a search filter (see the Filter class), but may only contain a single
element (i.e., no AND, OR, or NOT components are allowed), and extensible
matching does not allow the use of the dnAttributes field.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteThe match type that will be used for approximate match filters.static final byteThe match type that will be used for equality match filters.static final byteThe match type that will be used for extensible match filters.static final byteThe match type that will be used for greater-or-equal match filters.static final byteThe match type that will be used for less-or-equal match filters.static final byteThe match type that will be used for presence match filters.static final byteThe match type that will be used for substring match filters. -
Method Summary
Modifier and TypeMethodDescriptionstatic MatchedValuesFilterCreates a new matched values filter from the provided search filter, if possible.static MatchedValuesFiltercreateApproximateFilter(String attributeType, byte[] assertionValue) Creates a new matched values filter for approximate matching with the provided information.static MatchedValuesFiltercreateApproximateFilter(String attributeType, String assertionValue) Creates a new matched values filter for approximate matching with the provided information.static MatchedValuesFiltercreateEqualityFilter(String attributeType, byte[] assertionValue) Creates a new matched values filter for equality matching with the provided information.static MatchedValuesFiltercreateEqualityFilter(String attributeType, String assertionValue) Creates a new matched values filter for equality matching with the provided information.static MatchedValuesFiltercreateExtensibleMatchFilter(String attributeType, String matchingRuleID, byte[] assertionValue) Creates a new matched values filter for extensible matching with the provided information.static MatchedValuesFiltercreateExtensibleMatchFilter(String attributeType, String matchingRuleID, String assertionValue) Creates a new matched values filter for extensible matching with the provided information.static MatchedValuesFiltercreateGreaterOrEqualFilter(String attributeType, byte[] assertionValue) Creates a new matched values filter for greater-or-equal matching with the provided information.static MatchedValuesFiltercreateGreaterOrEqualFilter(String attributeType, String assertionValue) Creates a new matched values filter for greater-or-equal matching with the provided information.static MatchedValuesFiltercreateLessOrEqualFilter(String attributeType, byte[] assertionValue) Creates a new matched values filter for less-or-equal matching with the provided information.static MatchedValuesFiltercreateLessOrEqualFilter(String attributeType, String assertionValue) Creates a new matched values filter for less-or-equal matching with the provided information.static MatchedValuesFiltercreatePresentFilter(String attributeType) Creates a new matched values filter for presence matching with the provided information.static MatchedValuesFiltercreateSubstringFilter(String attributeType, byte[] subInitialValue, byte[][] subAnyValues, byte[] subFinalValue) Creates a new matched values filter for substring matching with the provided information.static MatchedValuesFiltercreateSubstringFilter(String attributeType, String subInitialValue, String[] subAnyValues, String subFinalValue) Creates a new matched values filter for substring matching with the provided information.static MatchedValuesFilterdecode(ASN1Element element) Decodes the provided ASN.1 element as a matched values filter.encode()Encodes this matched values filter for use in the matched values control.Retrieves the string representation of the assertion value for this matched values filter, if available.byte[]Retrieves the binary representation of the assertion value for this matched values filter, if available.Retrieves the name of the attribute type for this matched values filter, if available.Retrieves the matching rule ID for this matched values filter, if available.byteRetrieves the match type for this matched values filter.Retrieves raw assertion value for this matched values filter, if available.Retrieves the raw subAny elements for this matched values filter, if available.Retrieves the raw subFinal element for this matched values filter, if available.Retrieves the raw subInitial element for this matched values filter, if available.byte[][]Retrieves the binary representations of the subAny elements for this matched values filter, if available.String[]Retrieves the string representations of the subAny elements for this matched values filter, if available.Retrieves the string representation of the subFinal element for this matched values filter, if available.byte[]Retrieves the binary representation of the subFinal element for this matched values filter, if available.Retrieves the string representation of the subInitial element for this matched values filter, if available.byte[]Retrieves the binary representation of the subInitial element for this matched values filter, if available.toFilter()Creates a search filter that is the equivalent of this matched values filter.toString()Retrieves a string representation of this matched values filter.voidtoString(StringBuilder buffer) Appends a string representation of this matched values filter to the provided buffer.
-
Field Details
-
MATCH_TYPE_EQUALITY
The match type that will be used for equality match filters.- See Also:
-
MATCH_TYPE_SUBSTRINGS
The match type that will be used for substring match filters.- See Also:
-
MATCH_TYPE_GREATER_OR_EQUAL
The match type that will be used for greater-or-equal match filters.- See Also:
-
MATCH_TYPE_LESS_OR_EQUAL
The match type that will be used for less-or-equal match filters.- See Also:
-
MATCH_TYPE_PRESENT
The match type that will be used for presence match filters.- See Also:
-
MATCH_TYPE_APPROXIMATE
The match type that will be used for approximate match filters.- See Also:
-
MATCH_TYPE_EXTENSIBLE
The match type that will be used for extensible match filters.- See Also:
-
-
Method Details
-
createEqualityFilter
@NotNull public static MatchedValuesFilter createEqualityFilter(@NotNull String attributeType, @NotNull String assertionValue) Creates a new matched values filter for equality matching with the provided information.- Parameters:
attributeType- The attribute type for the filter. It must not benull.assertionValue- The assertion value for the filter. It must not benull.- Returns:
- The created equality match filter.
-
createEqualityFilter
@NotNull public static MatchedValuesFilter createEqualityFilter(@NotNull String attributeType, @NotNull byte[] assertionValue) Creates a new matched values filter for equality matching with the provided information.- Parameters:
attributeType- The attribute type for the filter. It must not benull.assertionValue- The assertion value for the filter. It must not benull.- Returns:
- The created equality match filter.
-
createSubstringFilter
@NotNull public static MatchedValuesFilter createSubstringFilter(@NotNull String attributeType, @Nullable String subInitialValue, @Nullable String[] subAnyValues, @Nullable String subFinalValue) Creates a new matched values filter for substring matching with the provided information. At least one substring filter element must be provided.- Parameters:
attributeType- The attribute type for the filter. It must not benull.subInitialValue- The subInitial value for the filter, ornullif there is no subInitial element.subAnyValues- The set of subAny values for the filter, ornullif there are no subAny elements.subFinalValue- The subFinal value for the filter, ornullif there is no subFinal element.- Returns:
- The created equality match filter.
-
createSubstringFilter
@NotNull public static MatchedValuesFilter createSubstringFilter(@NotNull String attributeType, @Nullable byte[] subInitialValue, @Nullable byte[][] subAnyValues, @Nullable byte[] subFinalValue) Creates a new matched values filter for substring matching with the provided information. At least one substring filter element must be provided.- Parameters:
attributeType- The attribute type for the filter. It must not benull.subInitialValue- The subInitial value for the filter, ornullif there is no subInitial element.subAnyValues- The set of subAny values for the filter, ornullif there are no subAny elements.subFinalValue- The subFinal value for the filter, ornullif there is no subFinal element.- Returns:
- The created equality match filter.
-
createGreaterOrEqualFilter
@NotNull public static MatchedValuesFilter createGreaterOrEqualFilter(@NotNull String attributeType, @NotNull String assertionValue) Creates a new matched values filter for greater-or-equal matching with the provided information.- Parameters:
attributeType- The attribute type for the filter. It must not benull.assertionValue- The assertion value for the filter. It must not benull.- Returns:
- The created greater-or-equal match filter.
-
createGreaterOrEqualFilter
@NotNull public static MatchedValuesFilter createGreaterOrEqualFilter(@NotNull String attributeType, @NotNull byte[] assertionValue) Creates a new matched values filter for greater-or-equal matching with the provided information.- Parameters:
attributeType- The attribute type for the filter. It must not benull.assertionValue- The assertion value for the filter. It must not benull.- Returns:
- The created greater-or-equal match filter.
-
createLessOrEqualFilter
@NotNull public static MatchedValuesFilter createLessOrEqualFilter(@NotNull String attributeType, @NotNull String assertionValue) Creates a new matched values filter for less-or-equal matching with the provided information.- Parameters:
attributeType- The attribute type for the filter. It must not benull.assertionValue- The assertion value for the filter. It must not benull.- Returns:
- The created less-or-equal match filter.
-
createLessOrEqualFilter
@NotNull public static MatchedValuesFilter createLessOrEqualFilter(@NotNull String attributeType, @NotNull byte[] assertionValue) Creates a new matched values filter for less-or-equal matching with the provided information.- Parameters:
attributeType- The attribute type for the filter. It must not benull.assertionValue- The assertion value for the filter. It must not benull.- Returns:
- The created less-or-equal match filter.
-
createPresentFilter
Creates a new matched values filter for presence matching with the provided information.- Parameters:
attributeType- The attribute type for the filter. It must not benull.- Returns:
- The created present match filter.
-
createApproximateFilter
@NotNull public static MatchedValuesFilter createApproximateFilter(@NotNull String attributeType, @NotNull String assertionValue) Creates a new matched values filter for approximate matching with the provided information.- Parameters:
attributeType- The attribute type for the filter. It must not benull.assertionValue- The assertion value for the filter. It must not benull.- Returns:
- The created approximate match filter.
-
createApproximateFilter
@NotNull public static MatchedValuesFilter createApproximateFilter(@NotNull String attributeType, @NotNull byte[] assertionValue) Creates a new matched values filter for approximate matching with the provided information.- Parameters:
attributeType- The attribute type for the filter. It must not benull.assertionValue- The assertion value for the filter. It must not benull.- Returns:
- The created greater-or-equal match filter.
-
createExtensibleMatchFilter
@NotNull public static MatchedValuesFilter createExtensibleMatchFilter(@Nullable String attributeType, @Nullable String matchingRuleID, @NotNull String assertionValue) Creates a new matched values filter for extensible matching with the provided information. At least one of the attribute type and matching rule ID must be provided.- Parameters:
attributeType- The attribute type for the filter, ornullif there is no attribute type.matchingRuleID- The matching rule ID for the filter, ornullif there is no matching rule ID.assertionValue- The assertion value for the filter. It must not benull.- Returns:
- The created extensible match filter.
-
createExtensibleMatchFilter
@NotNull public static MatchedValuesFilter createExtensibleMatchFilter(@Nullable String attributeType, @Nullable String matchingRuleID, @NotNull byte[] assertionValue) Creates a new matched values filter for extensible matching with the provided information. At least one of the attribute type and matching rule ID must be provided.- Parameters:
attributeType- The attribute type for the filter, ornullif there is no attribute type.matchingRuleID- The matching rule ID for the filter, ornullif there is no matching rule ID.assertionValue- The assertion value for the filter. It must not benull.- Returns:
- The created extensible match filter.
-
create
Creates a new matched values filter from the provided search filter, if possible.- Parameters:
filter- The search filter to use to create this matched values filter.- Returns:
- The search filter that corresponds to this matched values filter.
- Throws:
LDAPException- If the provided search filter cannot be represented as a matched values filter.
-
getMatchType
Retrieves the match type for this matched values filter.- Returns:
- The match type for this matched values filter.
-
getAttributeType
Retrieves the name of the attribute type for this matched values filter, if available.- Returns:
- The name of the attribute type for this matched values filter, or
nullif there is none.
-
getAssertionValue
Retrieves the string representation of the assertion value for this matched values filter, if available.- Returns:
- The string representation of the assertion value for this matched
values filter, or
nullif there is none.
-
getAssertionValueBytes
Retrieves the binary representation of the assertion value for this matched values filter, if available.- Returns:
- The binary representation of the assertion value for this matched
values filter, or
nullif there is none.
-
getRawAssertionValue
Retrieves raw assertion value for this matched values filter, if available.- Returns:
- The raw assertion value for this matched values filter, or
nullif there is none.
-
getSubInitialValue
Retrieves the string representation of the subInitial element for this matched values filter, if available.- Returns:
- The string representation of the subInitial element for this
matched values filter, or
nullif there is none.
-
getSubInitialValueBytes
Retrieves the binary representation of the subInitial element for this matched values filter, if available.- Returns:
- The binary representation of the subInitial element for this
matched values filter, or
nullif there is none.
-
getRawSubInitialValue
Retrieves the raw subInitial element for this matched values filter, if available.- Returns:
- The raw subInitial element for this matched values filter, or
nullif there is none.
-
getSubAnyValues
Retrieves the string representations of the subAny elements for this matched values filter, if available.- Returns:
- The string representations of the subAny element for this matched values filter, or an empty array if there are none.
-
getSubAnyValueBytes
Retrieves the binary representations of the subAny elements for this matched values filter, if available.- Returns:
- The binary representations of the subAny element for this matched values filter, or an empty array if there are none.
-
getRawSubAnyValues
Retrieves the raw subAny elements for this matched values filter, if available.- Returns:
- The raw subAny element for this matched values filter, or an empty array if there are none.
-
getSubFinalValue
Retrieves the string representation of the subFinal element for this matched values filter, if available.- Returns:
- The string representation of the subFinal element for this
matched values filter, or
nullif there is none.
-
getSubFinalValueBytes
Retrieves the binary representation of the subFinal element for this matched values filter, if available.- Returns:
- The binary representation of the subFinal element for this matched
values filter, or
nullif there is none.
-
getRawSubFinalValue
Retrieves the raw subFinal element for this matched values filter, if available.- Returns:
- The raw subFinal element for this matched values filter, or
nullif there is none.
-
getMatchingRuleID
Retrieves the matching rule ID for this matched values filter, if available.- Returns:
- The matching rule ID for this matched values filter, or
nullif there is none.
-
encode
Encodes this matched values filter for use in the matched values control.- Returns:
- The ASN.1 element containing the encoded representation of this matched values filter.
-
decode
@NotNull public static MatchedValuesFilter decode(@NotNull ASN1Element element) throws LDAPException Decodes the provided ASN.1 element as a matched values filter.- Parameters:
element- The ASN.1 element to decode as a matched values filter.- Returns:
- The decoded matched values filter.
- Throws:
LDAPException- If the provided ASN.1 element cannot be decoded as a matched values filter.
-
toFilter
Creates a search filter that is the equivalent of this matched values filter.- Returns:
- A search filter that is the equivalent of this matched values filter.
-
toString
Retrieves a string representation of this matched values filter. -
toString
Appends a string representation of this matched values filter to the provided buffer.- Parameters:
buffer- The buffer to which to append the string representation of this matched values filter.
-