Class Predicates
java.lang.Object
com.oracle.coherence.concurrent.executor.function.Predicates
Helper methods for
Remote.Predicate
s.- Since:
- 21.12
- Author:
- bo
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
AnPredicates.AlwaysPredicate
returns true for any value provided to thePredicate.test(Object)
method.static class
ARemote.Predicate
to compare a value usingObject.equals(Object)
.static class
AnPredicates.IsValuePredicate
returns true when a providedResult.isValue()
.static class
ARemote.Predicate
that negates the result of anotherRemote.Predicate
.static class
AnPredicates.NeverPredicate
returns false for any value provided to thePredicate.test(Object)
method.static class
AnPredicates.NullValuePredicate
returnstrue
for any value provided to thePredicate.test(Object)
method that isnull
.static class
ARemote.Predicate
to determine if anTaskExecutorService.ExecutorInfo
has a specificTaskExecutorService.Registration.Option
.static class
ARemote.Predicate
for matching the name of aRole
.static class
AnPredicates.ThrowablePredicate
returns true when a providedResult.isThrowable()
. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Remote.Predicate
<T> always()
Obtains aRemote.Predicate
that always succeeds.static <T> Remote.Predicate
<T> anything()
Obtains aRemote.Predicate
that always succeeds.static <T> Remote.Predicate
<Result<T>> Obtains aRemote.Predicate
that succeeds whenResult.isPresent()
()}.static <T> Remote.Predicate
<T> equalTo
(T value) Obtains aRemote.Predicate
that 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.Predicate
forTaskExecutorService.ExecutorInfo
to determine if a specificTaskExecutorService.Registration.Option
is 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.Predicate
that usesObject.equals(Object)
to compare against a specified value.static <T> Remote.Predicate
<T> never()
Obtains aRemote.Predicate
that never succeeds.static <T> Remote.Predicate
<T> not
(Remote.Predicate<T> predicate) Obtains aRemote.Predicate
that negates the result of anotherRemote.Predicate
.static <T> Remote.Predicate
<T> Obtains aRemote.Predicate
that succeeds when provided with a non-null
value.static <T> Remote.Predicate
<T> Obtains aRemote.Predicate
that succeeds when provided with anull
value.static <T> Remote.Predicate
<Result<T>> Obtains aRemote.Predicate
to ensure that theThrowable
is 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.Predicate
that always succeeds.- Type Parameters:
T
- the type of value- Returns:
- a
Remote.Predicate
-
anything
Obtains aRemote.Predicate
that always succeeds.- Type Parameters:
T
- the type of value- Returns:
- a
Remote.Predicate
-
never
Obtains aRemote.Predicate
that never succeeds.- Type Parameters:
T
- the type of value- Returns:
- a
Remote.Predicate
-
nullValue
Obtains aRemote.Predicate
that succeeds when provided with anull
value.- Type Parameters:
T
- the type of value- Returns:
- a
Remote.Predicate
-
notNullValue
Obtains aRemote.Predicate
that succeeds when provided with a non-null
value.- Type Parameters:
T
- the type of value- Returns:
- a
Remote.Predicate
-
equalTo
Obtains aRemote.Predicate
that 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.Predicate
that 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.Predicate
to return- Returns:
- the specified
Remote.Predicate
-
not
Obtains aRemote.Predicate
that negates the result of anotherRemote.Predicate
.- Type Parameters:
T
- the type of the value- Parameters:
predicate
- theRemote.Predicate
to negate- Returns:
- a
Remote.Predicate
-
available
Obtains aRemote.Predicate
that succeeds whenResult.isPresent()
()}.- Type Parameters:
T
- the type ofTask
result- Returns:
- a
Remote.Predicate
-
role
public static Remote.Predicate<com.oracle.coherence.concurrent.executor.TaskExecutorService.ExecutorInfo> role(String pattern) - Parameters:
pattern
- theRole
name pattern to match- Returns:
- a
Remote.Predicate
forTaskExecutorService.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.Predicate
forTaskExecutorService.ExecutorInfo
to determine if a specificTaskExecutorService.Registration.Option
is defined.- Parameters:
option
- theTaskExecutorService.Registration.Option
- Returns:
- a
Remote.Predicate
forTaskExecutorService.ExecutorInfo
-
onException
Obtains aRemote.Predicate
to ensure that theThrowable
is handled.- Type Parameters:
T
- the type of the task- Returns:
- a
Remote.Predicate
forThrowable
-
onException
- Type Parameters:
T
- the type of the task- Parameters:
throwable
- a result with a throwable- Returns:
- a
Remote.Predicate
for a givenThrowable
-