Interface UnaryEquator<T>
-
- Type Parameters:
T
- Type of compared entity
- All Superinterfaces:
java.util.function.BiPredicate<T,T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface UnaryEquator<T> extends java.util.function.BiPredicate<T,T>
Checks equality between 2 entities of same type
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description default UnaryEquator<T>
and(UnaryEquator<? super T> other)
Returns a composed equator that represents a short-circuiting logical AND of this equator and another.static <T> UnaryEquator<T>
comparing(java.util.Comparator<? super T> c)
static <T> UnaryEquator<T>
defaultEquality()
static <T> UnaryEquator<T>
falsum()
static <T> boolean
isSameReference(T o1, T o2)
default UnaryEquator<T>
negate()
default UnaryEquator<T>
or(UnaryEquator<? super T> other)
Returns a composed equator that represents a short-circuiting logical AND of this equator and another.static <T> UnaryEquator<T>
referenceEquality()
static <T> UnaryEquator<T>
verum()
-
-
-
Method Detail
-
and
default UnaryEquator<T> and(UnaryEquator<? super T> other)
Returns a composed equator that represents a short-circuiting logical AND of this equator and another. When evaluating the composed equator, if this equator isfalse
, then theother
equator is not evaluated.- Parameters:
other
- The other (nevernull
equator- Returns:
- The compound equator
-
or
default UnaryEquator<T> or(UnaryEquator<? super T> other)
Returns a composed equator that represents a short-circuiting logical AND of this equator and another. When evaluating the composed equator, if this equator istrue
, then theother
equator is not evaluated.- Parameters:
other
- The other (nevernull
equator- Returns:
- The compound equator
-
negate
default UnaryEquator<T> negate()
-
isSameReference
static <T> boolean isSameReference(T o1, T o2)
-
defaultEquality
static <T> UnaryEquator<T> defaultEquality()
- Type Parameters:
T
- Type of entity- Returns:
- The default equality checker
- See Also:
Objects.equals(Object, Object)
-
referenceEquality
static <T> UnaryEquator<T> referenceEquality()
- Type Parameters:
T
- Type of entity- Returns:
- An equator that checks reference equality
- See Also:
isSameReference(Object, Object)
-
comparing
static <T> UnaryEquator<T> comparing(java.util.Comparator<? super T> c)
- Type Parameters:
T
- Type of entity- Parameters:
c
- The (nevernull
) comparator- Returns:
- The equivalent equator
-
verum
static <T> UnaryEquator<T> verum()
- Type Parameters:
T
- Type of evaluated entity- Returns:
- A
UnaryEquator
that returns alwaystrue
- See Also:
- verum
-
falsum
static <T> UnaryEquator<T> falsum()
- Type Parameters:
T
- Type of evaluated entity- Returns:
- A
UnaryEquator
that returns alwaysfalse
- See Also:
- falsum
-
-