Class Predicates
java.lang.Object
com.oracle.coherence.concurrent.executor.function.Predicates
Helper methods for
Remote.Predicates.- Since:
- 21.12
- Author:
- bo
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAnPredicates.AlwaysPredicatereturns true for any value provided to thePredicate.test(Object)method.static classARemote.Predicateto compare a value usingObject.equals(Object).static classAnPredicates.IsValuePredicatereturns true when a providedResult.isValue().static classARemote.Predicatethat negates the result of anotherRemote.Predicate.static classAnPredicates.NeverPredicatereturns false for any value provided to thePredicate.test(Object)method.static classAnPredicates.NullValuePredicatereturnstruefor any value provided to thePredicate.test(Object)method that isnull.static classARemote.Predicateto determine if anTaskExecutorService.ExecutorInfohas a specificTaskExecutorService.Registration.Option.static classARemote.Predicatefor matching the name of aRole.static classAnPredicates.ThrowablePredicatereturns true when a providedResult.isThrowable(). -
Method Summary
Modifier and TypeMethodDescriptionstatic <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>> 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> Obtains aRemote.Predicatethat succeeds when provided with a non-nullvalue.static <T> Remote.Predicate<T> Obtains aRemote.Predicatethat succeeds when provided with anullvalue.static <T> Remote.Predicate<Result<T>> 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>
-
Method Details
-
always
Obtains aRemote.Predicatethat always succeeds.- Type Parameters:
T- the type of value- Returns:
- a
Remote.Predicate
-
anything
Obtains aRemote.Predicatethat always succeeds.- Type Parameters:
T- the type of value- Returns:
- a
Remote.Predicate
-
never
Obtains aRemote.Predicatethat never succeeds.- Type Parameters:
T- the type of value- Returns:
- a
Remote.Predicate
-
nullValue
Obtains aRemote.Predicatethat succeeds when provided with anullvalue.- Type Parameters:
T- the type of value- Returns:
- a
Remote.Predicate
-
notNullValue
Obtains aRemote.Predicatethat succeeds when provided with a non-nullvalue.- Type Parameters:
T- the type of value- Returns:
- a
Remote.Predicate
-
equalTo
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
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:
-
is
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
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
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
Obtains aRemote.Predicateto ensure that theThrowableis handled.- Type Parameters:
T- the type of the task- Returns:
- a
Remote.PredicateforThrowable
-
onException
- Type Parameters:
T- the type of the task- Parameters:
throwable- a result with a throwable- Returns:
- a
Remote.Predicatefor a givenThrowable
-