Class Predicates


  • public final class Predicates
    extends Object
    Helper methods for Remote.Predicates.
    Since:
    21.12
    Author:
    bo
    • Method Detail

      • always

        public static <T> com.tangosol.util.function.Remote.Predicate<T> always()
        Obtains a Remote.Predicate that always succeeds.
        Type Parameters:
        T - the type of value
        Returns:
        a Remote.Predicate
      • anything

        public static <T> com.tangosol.util.function.Remote.Predicate<T> anything()
        Obtains a Remote.Predicate that always succeeds.
        Type Parameters:
        T - the type of value
        Returns:
        a Remote.Predicate
      • never

        public static <T> com.tangosol.util.function.Remote.Predicate<T> never()
        Obtains a Remote.Predicate that never succeeds.
        Type Parameters:
        T - the type of value
        Returns:
        a Remote.Predicate
      • nullValue

        public static <T> com.tangosol.util.function.Remote.Predicate<T> nullValue()
        Obtains a Remote.Predicate that succeeds when provided with a null value.
        Type Parameters:
        T - the type of value
        Returns:
        a Remote.Predicate
      • notNullValue

        public static <T> com.tangosol.util.function.Remote.Predicate<T> notNullValue()
        Obtains a Remote.Predicate that succeeds when provided with a non-null value.
        Type Parameters:
        T - the type of value
        Returns:
        a Remote.Predicate
      • equalTo

        public static <T> com.tangosol.util.function.Remote.Predicate<T> equalTo​(T value)
        Obtains a Remote.Predicate that uses Object.equals(Object) to compare against a specified value.
        Type Parameters:
        T - the type of value
        Parameters:
        value - the value to compare
        Returns:
        a Remote.Predicate
      • is

        public static <T> com.tangosol.util.function.Remote.Predicate<T> is​(T value)
        Obtains a Remote.Predicate that uses Object.equals(Object) to compare against a specified value.
        Type Parameters:
        T - the type of value
        Parameters:
        value - the value to compare
        Returns:
        a Remote.Predicate
        See Also:
        equalTo(Object)
      • is

        public static <T> com.tangosol.util.function.Remote.Predicate<T> is​(com.tangosol.util.function.Remote.Predicate<T> predicate)
        Returns the specified Remote.Predicate.

        This is syntactic sugar to allow more expressive predicate construction.

        Type Parameters:
        T - the type of value for the Remote.Predicate
        Parameters:
        predicate - the Remote.Predicate to return
        Returns:
        the specified Remote.Predicate
      • not

        public static <T> com.tangosol.util.function.Remote.Predicate<T> not​(com.tangosol.util.function.Remote.Predicate<T> predicate)
        Obtains a Remote.Predicate that negates the result of another Remote.Predicate.
        Type Parameters:
        T - the type of the value
        Parameters:
        predicate - the Remote.Predicate to negate
        Returns:
        a Remote.Predicate
      • available

        public static <T> com.tangosol.util.function.Remote.Predicate<Result<T>> available()
        Obtains a Remote.Predicate that succeeds when Result.isPresent() ()}.
        Type Parameters:
        T - the type of Task result
        Returns:
        a Remote.Predicate
      • onException

        public static <T> com.tangosol.util.function.Remote.Predicate<Result<T>> onException()
        Obtains a Remote.Predicate to ensure that the Throwable is handled.
        Type Parameters:
        T - the type of the task
        Returns:
        a Remote.Predicate for Throwable
      • onException

        public static <T> com.tangosol.util.function.Remote.Predicate<Result<T>> onException​(Throwable throwable)
        Obtains a Remote.Predicate to ensure that the Result satisfies a specified Remote.Predicate.
        Type Parameters:
        T - the type of the task
        Parameters:
        throwable - a result with a throwable
        Returns:
        a Remote.Predicate for a given Throwable