T - type of objects to comparepublic interface Equalator<T>
Comparator, but has limited return value,
it is possible to wrap an existing comparator with the Wrap(Comparator) method.| Modifier and Type | Interface and Description |
|---|---|
static class |
Equalator.ComparatorWrapper<T> |
static interface |
Equalator.Provider<T> |
static class |
Equalator.Sequence<T>
Useful for implementing SQL-like "GROUP BY" for collections.
|
| Modifier and Type | Method and Description |
|---|---|
static <E> Equalator<E> |
Chain(Equalator<? super E>... equalators) |
boolean |
equal(T object1,
T object2)
Compares the two given objects (object1 and object2) depending on the implementation.
|
static <E> Equalator<E> |
identity() |
default Predicate<T> |
sample(T sample)
Creates a
Predicate that checks
every given object with equality
against the set sample. |
static <E> Equalator<E> |
value() |
static <E> Equalator<E> |
Wrap(Comparator<? super E> comparator)
Wraps a given
Comparator into an Equalator. |
boolean equal(T object1, T object2)
object1 - as first object to check equality onobject2 - as second object to check equality ontrue if object1 equals object2, false if not.default Predicate<T> sample(T sample)
Predicate that checks
every given object with equality
against the set sample.sample - which is comparedstatic <E> Equalator<E> Wrap(Comparator<? super E> comparator)
Comparator into an Equalator.
Resulting Equalator returns true if the comparator return 0.
In all other cases false is returned.E - type of objects to comparecomparator - to wrap insinde a new Equalator@SafeVarargs static <E> Equalator<E> Chain(Equalator<? super E>... equalators)
E - type of objects to compareequalators - to chain togetherEqualator and only if all Equalators return true,
this created Equalator returns true.static <E> Equalator<E> value()
E - type of objects to compareObject.equals(Object) method.static <E> Equalator<E> identity()
E - type of objects to compare'=='-Operator.Copyright © 2022 MicroStream Software. All rights reserved.