Uses of Interface
ratpack.func.Function
-
Packages that use Function Package Description ratpack.config Provides the ability to access configuration data from a variety of sources, such as YAML, JSON, properties files, system properties, and environment variables.ratpack.core.health Health checks report on the status of key components in the system and are generally used for monitoring and reporting.ratpack.core.http.client The HTTP client.ratpack.core.impose ratpack.core.jackson Integration with the Jackson JSON marshalling library.ratpack.core.server Objects used to start a ratpack application.ratpack.core.websocket Support for Websockets.ratpack.exec The execution management.ratpack.exec.registry Registries hold objects that can be retrieved via type, and are a key aspect of Ratpack applications.ratpack.exec.stream Support for reactive streams.ratpack.func ratpack.groovy Support for writing Ratpack applications in the Groovy programming language.ratpack.groovy.server Groovy implementations of the Ratpack server building classes.ratpack.gson Provides integration with Google Gson for JSON parsing and rendering.ratpack.guice Integration with Google Guice.ratpack.test.embed Support for creating embedded applications at test time, for testing Ratpack features and extensions.ratpack.test.exec -
-
Uses of Function in ratpack.config
Methods in ratpack.config with parameters of type Function Modifier and Type Method Description ConfigDataBuilder
ConfigDataBuilder. env(String prefix, Function<String,String> mapFunc)
Adds a configuration source for environment variables starting with the specified prefix. -
Uses of Function in ratpack.core.health
Methods in ratpack.core.health with parameters of type Function Modifier and Type Method Description static HealthCheck
HealthCheck. of(String name, Function<? super Registry,? extends Promise<HealthCheck.Result>> func)
Convenience factory for health check implementations. -
Uses of Function in ratpack.core.http.client
Methods in ratpack.core.http.client with parameters of type Function Modifier and Type Method Description RequestSpec
RequestSpec. onRedirect(Function<? super ReceivedResponse,Action<? super RequestSpec>> function)
Specifies a function to invoke when a redirectable response is received. -
Uses of Function in ratpack.core.impose
Methods in ratpack.core.impose with parameters of type Function Modifier and Type Method Description static UserRegistryImposition
UserRegistryImposition. of(Function<? super Registry,? extends Registry> registry)
Creates an imposition of registry returned by the given function. -
Uses of Function in ratpack.core.jackson
Methods in ratpack.core.jackson that return Function Modifier and Type Method Description static <T> Function<T,String>
Jackson. toJson(Registry registry)
Deprecated.since 1.10 with no replacement -
Uses of Function in ratpack.core.server
Methods in ratpack.core.server with parameters of type Function Modifier and Type Method Description ServerConfigBuilder
ServerConfigBuilder. env(String prefix, Function<String,String> mapFunc)
Adds a configuration source for environment variables starting with the specified prefix.RatpackServerSpec
RatpackServerSpec. handler(Function<? super Registry,? extends Handler> handlerFactory)
Sets the root handler to the return of the given function.RatpackServerSpec
RatpackServerSpec. registry(Function<? super Registry,? extends Registry> function)
Sets the user registry as the return value of the given function. -
Uses of Function in ratpack.core.websocket
Methods in ratpack.core.websocket with parameters of type Function Modifier and Type Method Description static <T> WebSocketConnector<T>
WebSockets. websocket(Context context, Function<WebSocket,T> openAction)
-
Uses of Function in ratpack.exec
Methods in ratpack.exec with parameters of type Function Modifier and Type Method Description default <O> Promise<O>
Promise. apply(Function<? super Promise<T>,? extends Promise<O>> function)
Applies the custom operation function to this promise.default <O> Promise<O>
Promise. blockingMap(Function<? super T,? extends O> transformer)
LikePromise.map(Function)
, but performs the transformation on a blocking thread.default Promise<T>
Promise. cacheResultFor(Function<? super ExecResult<T>,Duration> cacheFor)
Caches the promise result for a calculated amount of time.ExecControllerSpec.BlockingSpec
ExecControllerSpec.BlockingSpec. executor(Function<ThreadFactory,ExecutorService> executorFactory)
Specify a factory for creating an executor service with the provider arguments.ExecControllerSpec.ExecutorServiceSpec
ExecControllerSpec.ExecutorServiceSpec. executor(Function<ThreadFactory,ExecutorService> executorFactory)
Specify a factory for creating an executor service with the provider arguments.default <O> Promise<Pair<O,T>>
Promise. flatLeft(Function<? super T,? extends Promise<O>> leftFunction)
Transforms the promised value to aPair
, with the value of the result of the given function as theleft
.default <O> Promise<O>
Promise. flatMap(Function<? super T,? extends Promise<O>> transformer)
Transforms the promised value by applying the given function to it that returns a promise for the transformed value.default <E extends Throwable>
Promise<T>Promise. flatMapError(Class<E> type, Function<? super E,? extends Promise<T>> function)
Transforms a failure of the given type (potentially into a value) by applying the given function to it.default Promise<T>
Promise. flatMapError(Function<? super Throwable,? extends Promise<T>> function)
Transforms a failure of the given type (potentially into a value) by applying the given function to it.default Promise<T>
Promise. flatMapError(Predicate<? super Throwable> predicate, Function<? super 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 Operation
Promise. flatOp(Function<? super T,? extends Operation> function)
Converts this promise to an operation, which is the return offunction
.default <O> Promise<Pair<T,O>>
Promise. flatRight(Function<? super T,? extends Promise<O>> rightFunction)
Transforms the promised value to aPair
, with the value of the result of the given function as theright
.default <O> Promise<Pair<O,T>>
Promise. left(Function<? super T,? extends O> leftFunction)
Transforms the promised value to aPair
, with the result of the given function as theleft
.default <O> Promise<O>
Promise. map(Function<? super T,? extends O> transformer)
Transforms the promised value by applying the given function to it.default <E extends Throwable>
Promise<T>Promise. mapError(Class<E> type, Function<? super E,? extends T> function)
Transforms a failure of the given type (potentially into a value) by applying the given function to it.default Promise<T>
Promise. mapError(Function<? super Throwable,? extends T> transformer)
Transforms the promise failure (potentially into a value) by applying the given function to it.default Promise<T>
Promise. mapError(Predicate<? super Throwable> predicate, Function<? super 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. nextOp(Function<? super T,? extends Operation> function)
Executes the operation returned by the given function.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 <O> Promise<Pair<T,O>>
Promise. right(Function<? super T,? extends O> rightFunction)
Transforms the promised value to aPair
, with the result of the given function as theright
.default <O> O
Operation. to(Function<? super Operation,? extends O> function)
default <O> O
Promise. to(Function<? super Promise<T>,? extends O> function)
Applies the given function tothis
and returns the result.<O> Promise<O>
Promise. transform(Function<? super Upstream<? extends T>,? extends Upstream<O>> upstreamTransformer)
Apply a custom transform to this promise. -
Uses of Function in ratpack.exec.registry
Methods in ratpack.exec.registry with parameters of type Function Modifier and Type Method Description default <T,O>
Optional<O>Registry. first(com.google.common.reflect.TypeToken<T> type, Function<? super T,? extends O> function)
Find and transform an item.default <T,O>
Optional<O>Registry. first(Class<T> type, Function<? super T,? extends O> function)
A convenience method forRegistry.first(TypeToken, Function)
. -
Uses of Function in ratpack.exec.stream
Methods in ratpack.exec.stream with parameters of type Function Modifier and Type Method Description static <I,O>
TransformablePublisher<O>Streams. flatMap(Publisher<I> input, Function<? super I,? extends Promise<? extends O>> function)
Returns a publisher that publishes items from the given input publisher after transforming each item via the given, promise returning, function.default <O> TransformablePublisher<O>
TransformablePublisher. flatMap(Function<? super T,? extends Promise<? extends O>> function)
static <T> TransformablePublisher<T>
Streams. flatYield(Function<? super YieldRequest,? extends Promise<T>> producer)
Creates a new publisher, backed by the given asynchronous data producing function.static <I,O>
TransformablePublisher<O>Streams. map(Publisher<I> input, Function<? super I,? extends O> function)
Returns a publisher that publishes items from the given input publisher after transforming each item via the given function.default <O> TransformablePublisher<O>
TransformablePublisher. map(Function<? super T,? extends O> function)
static <T> TransformablePublisher<T>
Streams. periodically(ScheduledExecutorService executorService, Duration duration, Function<? super Integer,? extends T> producer)
Executes the given function periodically, publishing the return value to the subscriber.static <T> TransformablePublisher<T>
Streams. periodically(Registry registry, Duration duration, Function<? super Integer,? extends T> producer)
static <T> TransformablePublisher<T>
Streams. yield(Function<? super YieldRequest,? extends T> producer)
Creates a new publisher, backed by the given data producing function. -
Uses of Function in ratpack.func
Methods in ratpack.func that return Function Modifier and Type Method Description default <T> Function<I,T>
Function. andThen(Function<? super O,? extends T> after)
Joinsthis
function with the given function.default <T> Function<T,O>
Function. compose(Function<? super T,? extends I> before)
Joins the given function withthis
function.static <I,O>
Function<I,O>Function. conditional(Action<? super Function.ConditionalSpec<I,O>> conditions)
Creates a function that delegates based on the specified conditions.static <I,O>
Function<I,O>Function. conditional(Function<? super I,? extends O> onElse, Action<? super Function.ConditionalSpec<I,O>> conditions)
Creates a function that delegates based on the specified conditions.static <T> Function<Object,T>
Function. constant(T t)
Returns a function that always returns the given argument.static <I,O>
Function<I,O>Function. from(Function<I,O> function)
Creates a function of this type from a JDK style function.static <I,O>
Function<I,O>Function. fromGuava(com.google.common.base.Function<I,O> function)
Creates a function of this type from a Guava style function.default <O> Function<T,O>
Predicate. function(O onTrue, O onFalse)
Creates a function the returns one of the given values.static <T> Function<T,T>
Function. identity()
Returns an identity function (return value always same as input).static <L,P extends Pair<L,?>>
Function<P,L>Pair. unpackLeft()
Convenience function for returning the left item of a pair.static <R,P extends Pair<?,R>>
Function<P,R>Pair. unpackRight()
Convenience function for returning the right item of a pair.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 toidentity()
.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.Methods in ratpack.func with parameters of type Function Modifier and Type Method Description default <V> BiFunction<I1,I2,V>
BiFunction. andThen(Function<? super O,? extends V> transform)
default <T> Function<I,T>
Function. andThen(Function<? super O,? extends T> after)
Joinsthis
function with the given function.default <T> Function<T,O>
Function. compose(Function<? super T,? extends I> before)
Joins the given function withthis
function.static <I,O>
Function<I,O>Function. conditional(Function<? super I,? extends O> onElse, Action<? super Function.ConditionalSpec<I,O>> conditions)
Creates a function that delegates based on the specified conditions.default <T> T
Block. map(Function<? super Block,? extends T> function)
Maps a block onto a new object with the provided function.<T> T
Pair. map(Function<? super Pair<L,R>,? extends T> function)
Applies the given function tothis
, returning the result.<T> Pair<T,R>
Pair. mapLeft(Function<? super L,? extends T> function)
Creates a new pair, with the left item being the result of applying the given function to the left item ofthis
.<T> Pair<L,T>
Pair. mapRight(Function<? super R,? extends T> function)
Creates a new pair, with the right item being the result of applying the given function to the right item ofthis
.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 toidentity()
.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 Function in ratpack.groovy
Methods in ratpack.groovy that return Function Modifier and Type Method Description static Function<Registry,Registry>
Groovy.Script. bindings()
Creates a registry building function from a Groovy script named "bindings.groovy".static Function<Registry,Registry>
Groovy.Script. bindings(boolean compileStatic)
Creates a registry building function from a Groovy script named "bindings.groovy".static Function<Registry,Registry>
Groovy.Script. bindings(boolean compileStatic, String scriptPath)
Creates a registry building function from a Groovy script.static Function<Registry,Registry>
Groovy.Script. bindingsWithArgs(boolean compileStatic, String scriptPath, String... args)
Creates a registry building function from a Groovy script.static Function<Registry,Handler>
Groovy.Script. handlers()
Creates a handler defining function from a "handlers.groovy" Groovy script.static Function<Registry,Handler>
Groovy.Script. handlers(boolean compileStatic)
Creates a handler defining function from a "handlers.groovy" Groovy script.static Function<Registry,Handler>
Groovy.Script. handlers(boolean compileStatic, String scriptPath)
Creates a handler defining function from a Groovy script.static Function<Registry,Handler>
Groovy.Script. handlersWithArgs(boolean compileStatic, String scriptPath, String... args)
Creates a handler defining function from a Groovy script. -
Uses of Function in ratpack.groovy.server
Methods in ratpack.groovy.server with parameters of type Function Modifier and Type Method Description GroovyRatpackServerSpec
GroovyRatpackServerSpec. handler(Function<? super Registry,? extends Handler> handlerFactory)
GroovyRatpackServerSpec
GroovyRatpackServerSpec. registry(Function<? super Registry,? extends Registry> function)
-
Uses of Function in ratpack.gson
Methods in ratpack.gson that return Function Modifier and Type Method Description static <T> Function<T,String>
Gson. toJson(Registry registry)
Creates a mapping function that returns the JSON representation as a string of the input object. -
Uses of Function in ratpack.guice
Methods in ratpack.guice that return Function Modifier and Type Method Description static Function<com.google.inject.Module,com.google.inject.Injector>
Guice. newInjectorFactory(ServerConfig serverConfig)
static Function<Registry,Registry>
Guice. registry(com.google.inject.Injector parentInjector, Action<? super BindingsSpec> bindings)
static Function<Registry,Registry>
Guice. registry(Action<? super BindingsSpec> bindings)
-
Uses of Function in ratpack.test.embed
Methods in ratpack.test.embed with parameters of type Function Modifier and Type Method Description static EmbeddedApp
EmbeddedApp. fromHandlerFactory(Function<? super Registry,? extends Handler> handlerFactory)
Creates an embedded application with a default launch config (no base dir, ephemeral port) and the given handler. -
Uses of Function in ratpack.test.exec
Methods in ratpack.test.exec with parameters of type Function Modifier and Type Method Description default void
ExecHarness. execute(Action<? super RegistrySpec> registry, Function<? super Execution,? extends Operation> function)
default void
ExecHarness. execute(Function<? super Execution,? extends Operation> function)
static void
ExecHarness. executeSingle(Action<? super RegistrySpec> registry, Function<? super Execution,? extends Operation> function)
static void
ExecHarness. executeSingle(Function<? super Execution,? extends Operation> function)
<T> ExecResult<T>
ExecHarness. yield(Action<? super RegistrySpec> registry, Function<? super Execution,? extends Promise<T>> func)
Synchronously returns a promised value.default <T> ExecResult<T>
ExecHarness. yield(Function<? super Execution,? extends Promise<T>> func)
Synchronously returns a promised value.static <T> ExecResult<T>
ExecHarness. yieldSingle(Action<? super RegistrySpec> registry, Function<? super Execution,? extends Promise<T>> func)
Creates an exec harness,executes
the given function with it before closing it, then returning execution result.static <T> ExecResult<T>
ExecHarness. yieldSingle(Function<? super Execution,? extends Promise<T>> func)
Creates an exec harness,executes
the given function with it before closing it, then returning execution result.
-