Class Predicates
- java.lang.Object
-
- com.oracle.coherence.concurrent.executor.function.Predicates
-
public final class Predicates extends Object
Helper methods forRemote.Predicates.- Since:
- 21.12
- Author:
- bo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPredicates.AlwaysPredicateAnPredicates.AlwaysPredicatereturns true for any value provided to thePredicate.test(Object)method.static classPredicates.EqualToPredicate<T>ARemote.Predicateto compare a value usingObject.equals(Object).static classPredicates.IsValuePredicate<T>AnPredicates.IsValuePredicatereturns true when a providedResult.isValue().static classPredicates.NegatePredicate<T>ARemote.Predicatethat negates the result of anotherRemote.Predicate.static classPredicates.NeverPredicateAnPredicates.NeverPredicatereturns false for any value provided to thePredicate.test(Object)method.static classPredicates.NullValuePredicateAnPredicates.NullValuePredicatereturnstruefor any value provided to thePredicate.test(Object)method that isnull.static classPredicates.OptionPredicateARemote.Predicateto determine if anTaskExecutorService.ExecutorInfohas a specificTaskExecutorService.Registration.Option.static classPredicates.RolePredicateARemote.Predicatefor matching the name of aRole.static classPredicates.ThrowablePredicate<T>AnPredicates.ThrowablePredicatereturns true when a providedResult.isThrowable().
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Remote.Predicate<T>always()Obtains aRemote.Predicatethat always succeeds.static <T> Remote.Predicate<T>anything()Obtains aRemote.Predicatethat always succeeds.static <T> Remote.Predicate<Result<T>>available()Obtains aRemote.Predicatethat succeeds whenResult.isPresent()()}.static <T> Remote.Predicate<T>equalTo(T value)Obtains aRemote.Predicatethat usesObject.equals(Object)to compare against a specified value.static Remote.Predicate<com.oracle.coherence.concurrent.executor.TaskExecutorService.ExecutorInfo>has(com.oracle.coherence.concurrent.executor.TaskExecutorService.Registration.Option option)Obtains aRemote.PredicateforTaskExecutorService.ExecutorInfoto determine if a specificTaskExecutorService.Registration.Optionis defined.static <T> Remote.Predicate<T>is(Remote.Predicate<T> predicate)Returns the specifiedRemote.Predicate.static <T> Remote.Predicate<T>is(T value)Obtains aRemote.Predicatethat usesObject.equals(Object)to compare against a specified value.static <T> Remote.Predicate<T>never()Obtains aRemote.Predicatethat never succeeds.static <T> Remote.Predicate<T>not(Remote.Predicate<T> predicate)Obtains aRemote.Predicatethat negates the result of anotherRemote.Predicate.static <T> Remote.Predicate<T>notNullValue()Obtains aRemote.Predicatethat succeeds when provided with a non-nullvalue.static <T> Remote.Predicate<T>nullValue()Obtains aRemote.Predicatethat succeeds when provided with anullvalue.static <T> Remote.Predicate<Result<T>>onException()Obtains aRemote.Predicateto ensure that theThrowableis handled.static <T> Remote.Predicate<Result<T>>onException(Throwable throwable)static Remote.Predicate<com.oracle.coherence.concurrent.executor.TaskExecutorService.ExecutorInfo>role(String pattern)
-
-
-
Method Detail
-
always
public static <T> Remote.Predicate<T> always()
Obtains aRemote.Predicatethat always succeeds.- Type Parameters:
T- the type of value- Returns:
- a
Remote.Predicate
-
anything
public static <T> Remote.Predicate<T> anything()
Obtains aRemote.Predicatethat always succeeds.- Type Parameters:
T- the type of value- Returns:
- a
Remote.Predicate
-
never
public static <T> Remote.Predicate<T> never()
Obtains aRemote.Predicatethat never succeeds.- Type Parameters:
T- the type of value- Returns:
- a
Remote.Predicate
-
nullValue
public static <T> Remote.Predicate<T> nullValue()
Obtains aRemote.Predicatethat succeeds when provided with anullvalue.- Type Parameters:
T- the type of value- Returns:
- a
Remote.Predicate
-
notNullValue
public static <T> Remote.Predicate<T> notNullValue()
Obtains aRemote.Predicatethat succeeds when provided with a non-nullvalue.- Type Parameters:
T- the type of value- Returns:
- a
Remote.Predicate
-
equalTo
public static <T> Remote.Predicate<T> equalTo(T value)
Obtains aRemote.Predicatethat usesObject.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> Remote.Predicate<T> is(T value)
Obtains aRemote.Predicatethat usesObject.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> Remote.Predicate<T> is(Remote.Predicate<T> predicate)
Returns the specifiedRemote.Predicate.This is syntactic sugar to allow more expressive predicate construction.
- Type Parameters:
T- the type of value for theRemote.Predicate- Parameters:
predicate- theRemote.Predicateto return- Returns:
- the specified
Remote.Predicate
-
not
public static <T> Remote.Predicate<T> not(Remote.Predicate<T> predicate)
Obtains aRemote.Predicatethat negates the result of anotherRemote.Predicate.- Type Parameters:
T- the type of the value- Parameters:
predicate- theRemote.Predicateto negate- Returns:
- a
Remote.Predicate
-
available
public static <T> Remote.Predicate<Result<T>> available()
Obtains aRemote.Predicatethat succeeds whenResult.isPresent()()}.- Type Parameters:
T- the type ofTaskresult- Returns:
- a
Remote.Predicate
-
role
public static Remote.Predicate<com.oracle.coherence.concurrent.executor.TaskExecutorService.ExecutorInfo> role(String pattern)
- Parameters:
pattern- theRolename pattern to match- Returns:
- a
Remote.PredicateforTaskExecutorService.ExecutorInfo
-
has
public static Remote.Predicate<com.oracle.coherence.concurrent.executor.TaskExecutorService.ExecutorInfo> has(com.oracle.coherence.concurrent.executor.TaskExecutorService.Registration.Option option)
Obtains aRemote.PredicateforTaskExecutorService.ExecutorInfoto determine if a specificTaskExecutorService.Registration.Optionis defined.- Parameters:
option- theTaskExecutorService.Registration.Option- Returns:
- a
Remote.PredicateforTaskExecutorService.ExecutorInfo
-
onException
public static <T> Remote.Predicate<Result<T>> onException()
Obtains aRemote.Predicateto ensure that theThrowableis handled.- Type Parameters:
T- the type of the task- Returns:
- a
Remote.PredicateforThrowable
-
onException
public static <T> Remote.Predicate<Result<T>> onException(Throwable throwable)
- Type Parameters:
T- the type of the task- Parameters:
throwable- a result with a throwable- Returns:
- a
Remote.Predicatefor a givenThrowable
-
-