Class FilterComparator
java.lang.Object
com.unboundid.ldap.sdk.unboundidds.examples.FilterComparator
- All Implemented Interfaces:
Serializable,Comparator<Filter>
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class FilterComparator
extends Object
implements Comparator<Filter>, Serializable
This class provides a comparator that may be used to define a relative order
for search filters. The filter order will be based first on the filter type
(in the following order: AND, OR, NOT, equality, substring,
greater-or-equal, less-or-equal, presence, approximate match, extensible
match), then based on the attribute name, and then by the assertion value.
For AND and OR filters, with all other things equal, a filter with fewer
components will be ordered before one with more components. For a substring
filter with all other things equal, then a filter missing a substring element
will be ordered before one with that element, and one with fewer subAny
elements will be ordered before one with more subAny elements. For an
extensible match filter with all other things being equal, a filter without
an element will be ordered before one with that element.
NOTE: This class, and other classes within the
com.unboundid.ldap.sdk.unboundidds package structure, are only
supported for use against Ping Identity, UnboundID, and
Nokia/Alcatel-Lucent 8661 server products. These classes provide support
for proprietary functionality or for external specifications that are not
considered stable or mature enough to be guaranteed to work in an
interoperable way with other types of LDAP servers.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionintDetermines a relative order for the provided filter objects.booleanIndicates whether the provided object is equal to this filter comparator.static FilterComparatorRetrieves the singleton instance of this filter comparator.inthashCode()Retrieves a hash code for this filter comparator.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Method Details
-
getInstance
Retrieves the singleton instance of this filter comparator.- Returns:
- The singleton instance of this filter comparator.
-
compare
Determines a relative order for the provided filter objects.- Specified by:
comparein interfaceComparator<Filter>- Parameters:
f1- The first filter for which to make the determination. It must not benullf2- The second filter for which to make the determination. It must not benull- Returns:
- A negative value if the first filter should be ordered before the second, a positive value if the first filter should be ordered after the second, or zero if there is no difference in their relative orders.
-
hashCode
Retrieves a hash code for this filter comparator. -
equals
Indicates whether the provided object is equal to this filter comparator.- Specified by:
equalsin interfaceComparator<Filter>- Overrides:
equalsin classObject- Parameters:
o- The object for which to make the determination.- Returns:
trueif the provided object is equal to this filter comparator, orfalseif not.
-