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 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 is false, then the other equator is not evaluated.
        Parameters:
        other - The other (never null 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 is true, then the other equator is not evaluated.
        Parameters:
        other - The other (never null equator
        Returns:
        The compound equator
      • negate

        default UnaryEquator<T> negate()
        Specified by:
        negate in interface java.util.function.BiPredicate<T,​T>
        Returns:
        an equator that represents the logical negation of this one
      • defaultEquality

        static <T> UnaryEquator<T> defaultEquality()
        Type Parameters:
        T - Type of entity
        Returns:
        The default equality checker
        See Also:
        Objects.equals(Object, Object)
      • comparing

        static <T> UnaryEquator<T> comparing​(java.util.Comparator<? super T> c)
        Converts a Comparator into a UnaryEquator that returns true if the comparator returns zero
        Type Parameters:
        T - Type of entity
        Parameters:
        c - The (never null) comparator
        Returns:
        The equivalent equator
      • verum

        static <T> UnaryEquator<T> verum()
        Type Parameters:
        T - Type of evaluated entity
        Returns:
        A UnaryEquator that returns always true
        See Also:
        verum
      • falsum

        static <T> UnaryEquator<T> falsum()
        Type Parameters:
        T - Type of evaluated entity
        Returns:
        A UnaryEquator that returns always false
        See Also:
        falsum