Package | Description |
---|---|
ratpack.exec |
The execution management.
|
ratpack.func |
General functional (i.e. Single Abstract Method) types.
|
ratpack.groovy.handling |
Groovy specific extensions to classes in the
ratpack.handling package. |
ratpack.handling |
The handling of application requests.
|
ratpack.service |
Services participate in the application start/stop lifecycle.
|
ratpack.stream |
Support for reactive streams.
|
Modifier and Type | Method and Description |
---|---|
default Promise<T> |
Promise.cacheIf(Predicate<? super T> shouldCache)
Caches the promise value and provides it to all future subscribers, if it satisfies the predicate.
|
default Promise<T> |
Promise.cacheResultIf(Predicate<? super ExecResult<T>> shouldCache)
Caches the promise result eternally and provide it to all future subscribers, if it satisfies the predicate.
|
default Promise<T> |
Promise.flatMapError(Predicate<? super java.lang.Throwable> predicate,
Function<? super java.lang.Throwable,? extends Promise<T>> function)
Transforms a failure of the given type (potentially into a value) by applying the given function to it.
|
default <O> Promise<O> |
Promise.flatMapIf(Predicate<? super T> predicate,
Function<? super T,? extends Promise<O>> onTrue,
Function<? super T,? extends Promise<O>> onFalse)
Transforms the promised value by applying one of the given functions to it that returns a promise for the transformed value, depending if it satisfies the predicate.
|
default Promise<T> |
Promise.flatMapIf(Predicate<? super T> predicate,
Function<? super T,? extends Promise<T>> transformer)
Transforms the promised value by applying the given function to it that returns a promise for the transformed value, if it satisfies the predicate.
|
default Promise<T> |
Promise.mapError(Predicate<? super java.lang.Throwable> predicate,
Function<? super java.lang.Throwable,? extends T> function)
Transforms a failure of the given type (potentially into a value) by applying the given function to it.
|
default <O> Promise<O> |
Promise.mapIf(Predicate<? super T> predicate,
Function<? super T,? extends O> onTrue,
Function<? super T,? extends O> onFalse)
Transforms the promised value by applying one of the given functions to it, depending if it satisfies the predicate.
|
default Promise<T> |
Promise.mapIf(Predicate<? super T> predicate,
Function<? super T,? extends T> transformer)
Transforms the promised value by applying the given function to it, if it satisfies the predicate.
|
default Promise<T> |
Promise.nextOpIf(Predicate<? super T> predicate,
Function<? super T,? extends Operation> function)
Executes the operation returned by the given function, if it satisfies the predicate.
|
default Promise<T> |
Promise.onError(Predicate<? super java.lang.Throwable> predicate,
Action<? super java.lang.Throwable> errorHandler)
Specifies the action to take if the an error occurs trying to produce the promised value, that the given predicate applies to.
|
default Promise<T> |
Promise.retryIf(Predicate<? super java.lang.Throwable> predicate,
RetryPolicy retryPolicy,
BiAction<? super java.lang.Integer,? super java.lang.Throwable> onError)
Causes
this yielding the promised value to be retried on error, under the rules of provided retryPolicy ,
and if the given Predicate matches the error thrown. |
default Promise<T> |
Promise.route(Predicate<? super T> predicate,
Action<? super T> action)
Allows the promised value to be handled specially if it meets the given predicate, instead of being handled by the promise subscriber.
|
Modifier and Type | Field and Description |
---|---|
static Predicate<java.lang.Object> |
Predicate.FALSE
A predicate that always returns
false , regardless of the input object. |
static Predicate<java.lang.Object> |
Predicate.TRUE
A predicate that always returns
true , regardless of the input object. |
Modifier and Type | Method and Description |
---|---|
static <T> Predicate<T> |
Predicate.alwaysFalse()
A predicate that always returns
false , regardless of the input object. |
static <T> Predicate<T> |
Predicate.alwaysTrue()
A predicate that always returns
true , regardless of the input object. |
static <T> Predicate<T> |
Predicate.from(java.util.function.Predicate<T> predicate)
Creates a predicate from a JDK predicate.
|
static <T> Predicate<T> |
Predicate.fromGuava(com.google.common.base.Predicate<T> predicate)
Creates a predicate from a Guava predicate.
|
Modifier and Type | Method and Description |
---|---|
Action.ConditionalSpec<I> |
Action.ConditionalSpec.when(Predicate<? super I> predicate,
Action<? super I> action) |
static <I> Action<I> |
Action.when(Predicate<? super I> predicate,
Action<? super I> action)
Creates an action that delegates to the given action if the given predicate applies, else delegates to
Action.noop() . |
static <I> Action<I> |
Action.when(Predicate<? super I> predicate,
Action<? super I> onTrue,
Action<? super I> onFalse)
Creates an action that delegates to the first action if the given predicate applies, else the second action.
|
static <I> Function<I,I> |
Function.when(Predicate<? super I> predicate,
Function<? super I,? extends I> function)
Creates a function that delegates to the given function if the given predicate applies, else delegates to
Function.identity() . |
Function.ConditionalSpec<I,O> |
Function.ConditionalSpec.when(Predicate<? super I> predicate,
Function<? super I,? extends O> function)
Adds a conditional function.
|
static <I,O> Function<I,O> |
Function.when(Predicate<? super I> predicate,
Function<? super I,? extends O> onTrue,
Function<? super I,? extends O> onFalse)
Creates a function that delegates to the first function if the given predicate applies, else the second function.
|
Modifier and Type | Method and Description |
---|---|
default GroovyChain |
GroovyChain.onlyIf(Predicate<? super Context> test,
java.lang.Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.onlyIf(Predicate<? super Context> test,
Closure<?> handler) |
default GroovyChain |
GroovyChain.onlyIf(Predicate<? super Context> test,
Handler handler)
Invokes the given handler only if the predicate passes.
|
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
Action<? super Chain> action) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
Action<? super Chain> onTrue,
Action<? super Chain> onFalse) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
java.lang.Class<? extends Action<? super Chain>> action) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
java.lang.Class<? extends Action<? super Chain>> onTrue,
java.lang.Class<? extends Action<? super Chain>> onFalse) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
Closure<?> handlers) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
Closure<?> ifHandlers,
Closure<?> elseHandlers) |
Modifier and Type | Method and Description |
---|---|
default Chain |
Chain.onlyIf(Predicate<? super Context> test,
java.lang.Class<? extends Handler> handler) |
default Chain |
Chain.onlyIf(Predicate<? super Context> test,
Handler handler)
Invokes the given handler only if the predicate passes.
|
static Handler |
Handlers.onlyIf(Predicate<? super Context> test,
Handler handler)
Creates a handler that delegates to the given handler if the predicate applies to the context.
|
default Chain |
Chain.when(Predicate<? super Context> test,
Action<? super Chain> action) |
default Chain |
Chain.when(Predicate<? super Context> test,
Action<? super Chain> onTrue,
Action<? super Chain> onFalse) |
default Chain |
Chain.when(Predicate<? super Context> test,
java.lang.Class<? extends Action<? super Chain>> action) |
default Chain |
Chain.when(Predicate<? super Context> test,
java.lang.Class<? extends Action<? super Chain>> onTrue,
java.lang.Class<? extends Action<? super Chain>> onFalse) |
static Handler |
Handlers.when(Predicate<? super Context> test,
Handler handler)
Creates a handler that inserts and delegates the given handler if the predicate applies to the context.
|
static Handler |
Handlers.whenOrElse(Predicate<? super Context> test,
Handler ifHandler,
Handler elseHandler)
Creates a handler that inserts and delegates to the appropriate handler depending if the predicate applies to the context.
|
Modifier and Type | Method and Description |
---|---|
default <T1,T2> ServiceDependenciesSpec |
ServiceDependenciesSpec.dependsOn(java.lang.Class<T1> dependentsType,
Predicate<? super T1> dependents,
java.lang.Class<T2> dependenciesType,
Predicate<? super T2> dependencies)
Specifies that all services that are of the given
dependentsType that match the dependents predicate are dependent on all services that are of the dependenciesType that match the dependencies predicate. |
default <T1,T2> ServiceDependenciesSpec |
ServiceDependenciesSpec.dependsOn(java.lang.Class<T1> dependentsType,
Predicate<? super T1> dependents,
java.lang.Class<T2> dependenciesType,
Predicate<? super T2> dependencies)
Specifies that all services that are of the given
dependentsType that match the dependents predicate are dependent on all services that are of the dependenciesType that match the dependencies predicate. |
ServiceDependenciesSpec |
ServiceDependenciesSpec.dependsOn(Predicate<? super Service> dependents,
Predicate<? super Service> dependencies)
Specifies that all services that match the
dependents predicate are dependent on all services that match the dependencies predicate. |
ServiceDependenciesSpec |
ServiceDependenciesSpec.dependsOn(Predicate<? super Service> dependents,
Predicate<? super Service> dependencies)
Specifies that all services that match the
dependents predicate are dependent on all services that match the dependencies predicate. |
Modifier and Type | Method and Description |
---|---|
default TransformablePublisher<T> |
TransformablePublisher.filter(Predicate<? super T> filter)
|
static <T> TransformablePublisher<T> |
Streams.filter(Publisher<T> input,
Predicate<? super T> filter)
Returns a publisher that filters items from the given input stream by applying the given filter predicate.
|