Uses of Interface
ratpack.func.Predicate
-
Packages that use Predicate 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 theratpack.handlingpackage.ratpack.handling The handling of application requests.ratpack.service Services participate in the application start/stop lifecycle.ratpack.stream Support for reactive streams. -
-
Uses of Predicate in ratpack.exec
Methods in ratpack.exec with parameters of type Predicate Modifier and Type Method 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.OperationOperation. onError(Predicate<? super java.lang.Throwable> predicate, Action<? super java.lang.Throwable> errorHandler)Specifies the action to take if the an error occurs performing the operation that the given predicate applies to.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)Causesthisyielding the promised value to be retried on error, under the rules of providedretryPolicy, and if the givenPredicatematches 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. -
Uses of Predicate in ratpack.func
Fields in ratpack.func declared as Predicate Modifier and Type Field Description static Predicate<java.lang.Object>Predicate. FALSEA predicate that always returnsfalse, regardless of the input object.static Predicate<java.lang.Object>Predicate. TRUEA predicate that always returnstrue, regardless of the input object.Methods in ratpack.func that return Predicate Modifier and Type Method Description static <T> Predicate<T>Predicate. alwaysFalse()A predicate that always returnsfalse, regardless of the input object.static <T> Predicate<T>Predicate. alwaysTrue()A predicate that always returnstrue, 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.Methods in ratpack.func with parameters of type Predicate Modifier and Type Method 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 toAction.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.Function.ConditionalSpec<I,O>Function.ConditionalSpec. when(Predicate<? super I> predicate, Function<? super I,? extends O> function)Adds a conditional function.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 toFunction.identity().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. -
Uses of Predicate in ratpack.groovy.handling
Methods in ratpack.groovy.handling with parameters of type Predicate Modifier and Type Method Description default GroovyChainGroovyChain. onlyIf(Predicate<? super Context> test, Closure<?> handler)default GroovyChainGroovyChain. onlyIf(Predicate<? super Context> test, java.lang.Class<? extends Handler> handler)default GroovyChainGroovyChain. onlyIf(Predicate<? super Context> test, Handler handler)Invokes the given handler only if the predicate passes.default GroovyChainGroovyChain. when(Predicate<? super Context> test, Closure<?> handlers)default GroovyChainGroovyChain. when(Predicate<? super Context> test, Closure<?> ifHandlers, Closure<?> elseHandlers)default GroovyChainGroovyChain. when(Predicate<? super Context> test, java.lang.Class<? extends Action<? super Chain>> action)default GroovyChainGroovyChain. when(Predicate<? super Context> test, java.lang.Class<? extends Action<? super Chain>> onTrue, java.lang.Class<? extends Action<? super Chain>> onFalse)default GroovyChainGroovyChain. when(Predicate<? super Context> test, Action<? super Chain> action)default GroovyChainGroovyChain. when(Predicate<? super Context> test, Action<? super Chain> onTrue, Action<? super Chain> onFalse) -
Uses of Predicate in ratpack.handling
Methods in ratpack.handling with parameters of type Predicate Modifier and Type Method Description default ChainChain. onlyIf(Predicate<? super Context> test, java.lang.Class<? extends Handler> handler)default ChainChain. onlyIf(Predicate<? super Context> test, Handler handler)Invokes the given handler only if the predicate passes.static HandlerHandlers. onlyIf(Predicate<? super Context> test, Handler handler)Creates a handler that delegates to the given handler if the predicate applies to the context.default ChainChain. when(Predicate<? super Context> test, java.lang.Class<? extends Action<? super Chain>> action)default ChainChain. when(Predicate<? super Context> test, java.lang.Class<? extends Action<? super Chain>> onTrue, java.lang.Class<? extends Action<? super Chain>> onFalse)default ChainChain. when(Predicate<? super Context> test, Action<? super Chain> action)default ChainChain. when(Predicate<? super Context> test, Action<? super Chain> onTrue, Action<? super Chain> onFalse)static HandlerHandlers. 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 HandlerHandlers. 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. -
Uses of Predicate in ratpack.service
Methods in ratpack.service with parameters of type Predicate Modifier and Type Method Description default <T1,T2>
ServiceDependenciesSpecServiceDependenciesSpec. 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 givendependentsTypethat match thedependentspredicate are dependent on all services that are of thedependenciesTypethat match thedependenciespredicate.ServiceDependenciesSpecServiceDependenciesSpec. dependsOn(Predicate<? super Service> dependents, Predicate<? super Service> dependencies)Specifies that all services that match thedependentspredicate are dependent on all services that match thedependenciespredicate. -
Uses of Predicate in ratpack.stream
Methods in ratpack.stream with parameters of type Predicate Modifier and Type Method Description 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.default TransformablePublisher<T>TransformablePublisher. filter(Predicate<? super T> filter)
-