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.exec |
The execution management.
|
ratpack.func |
General functional (i.e. Single Abstract Method) types.
|
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.health |
Health checks report on the status of key components in the system and are generally used for monitoring and reporting.
|
ratpack.http.client |
The HTTP client.
|
ratpack.impose | |
ratpack.jackson |
Integration with the Jackson JSON marshalling library.
|
ratpack.registry |
Registries hold objects that can be retrieved via type, and are a key aspect of Ratpack applications.
|
ratpack.server |
Objects used to start a ratpack application.
|
ratpack.sse |
Support for Server Sent Events.
|
ratpack.stream |
Support for reactive streams.
|
ratpack.test.embed |
Support for creating embedded applications at test time, for testing Ratpack features and extensions.
|
ratpack.test.exec | |
ratpack.websocket |
Support for Websockets.
|
Modifier and Type | Method and Description |
---|---|
ConfigDataBuilder |
ConfigDataBuilder.env(java.lang.String prefix,
Function<java.lang.String,java.lang.String> mapFunc)
Adds a configuration source for environment variables starting with the specified prefix.
|
Modifier and Type | Method and 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)
Like
Promise.map(Function) , but performs the transformation on a blocking thread. |
default Promise<T> |
Promise.cacheResultFor(Function<? super ExecResult<T>,java.time.Duration> cacheFor)
Caches the promise result for a calculated amount of time.
|
default <O> Promise<Pair<O,T>> |
Promise.flatLeft(Function<? super T,? extends Promise<O>> leftFunction)
Transforms the promised value to a
Pair , with the value of the result of the given function as the left . |
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 java.lang.Throwable> |
Promise.flatMapError(java.lang.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 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 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 <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 of
function . |
default <O> Promise<Pair<T,O>> |
Promise.flatRight(Function<? super T,? extends Promise<O>> rightFunction)
Transforms the promised value to a
Pair , with the value of the result of the given function as the right . |
default <O> Promise<Pair<O,T>> |
Promise.left(Function<? super T,? extends O> leftFunction)
Transforms the promised value to a
Pair , with the result of the given function as the left . |
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 java.lang.Throwable> |
Promise.mapError(java.lang.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 java.lang.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 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 <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 a
Pair , with the result of the given function as the right . |
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 to
this 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.
|
Modifier and Type | Method and Description |
---|---|
default <T> Function<I,T> |
Function.andThen(Function<? super O,? extends T> after)
Joins
this function with the given function. |
default <T> Function<T,O> |
Function.compose(Function<? super T,? extends I> before)
Joins the given function with
this 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<java.lang.Object,T> |
Function.constant(T t)
Returns a function that always returns the given argument.
|
static <I,O> Function<I,O> |
Function.from(java.util.function.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,?>> |
Pair.unpackLeft()
Convenience function for returning the left item of a pair.
|
static <R,P extends Pair<?,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 to
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.
|
Modifier and Type | Method and Description |
---|---|
default <T> Function<I,T> |
Function.andThen(Function<? super O,? extends T> after)
Joins
this function with the given function. |
default <V> BiFunction<I1,I2,V> |
BiFunction.andThen(Function<? super O,? extends V> transform) |
default <T> Function<T,O> |
Function.compose(Function<? super T,? extends I> before)
Joins the given function with
this 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 to
this , 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 of
this . |
<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 of
this . |
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
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.
|
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 |
---|---|
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,
java.lang.String scriptPath)
Creates a registry building function from a Groovy script.
|
static Function<Registry,Registry> |
Groovy.Script.bindingsWithArgs(boolean compileStatic,
java.lang.String scriptPath,
java.lang.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,
java.lang.String scriptPath)
Creates a handler defining function from a Groovy script.
|
static Function<Registry,Handler> |
Groovy.Script.handlersWithArgs(boolean compileStatic,
java.lang.String scriptPath,
java.lang.String... args)
Creates a handler defining function from a Groovy script.
|
Modifier and Type | Method and Description |
---|---|
GroovyRatpackServerSpec |
GroovyRatpackServerSpec.handler(Function<? super Registry,? extends Handler> handlerFactory) |
GroovyRatpackServerSpec |
GroovyRatpackServerSpec.registry(Function<? super Registry,? extends Registry> function) |
Modifier and Type | Method and Description |
---|---|
static <T> Function<T,java.lang.String> |
Gson.toJson(Registry registry)
Creates a mapping function that returns the JSON representation as a string of the input object.
|
Modifier and Type | Method and Description |
---|---|
static Function<Module,Injector> |
Guice.newInjectorFactory(ServerConfig serverConfig) |
static Function<Registry,Registry> |
Guice.registry(Action<? super BindingsSpec> bindings) |
static Function<Registry,Registry> |
Guice.registry(Injector parentInjector,
Action<? super BindingsSpec> bindings) |
Modifier and Type | Method and Description |
---|---|
static HealthCheck |
HealthCheck.of(java.lang.String name,
Function<? super Registry,? extends Promise<HealthCheck.Result>> func)
Convenience factory for health check implementations.
|
Modifier and Type | Method and Description |
---|---|
RequestSpec |
RequestSpec.onRedirect(Function<? super ReceivedResponse,Action<? super RequestSpec>> function)
Specifies a function to invoke when a redirectable response is received.
|
Modifier and Type | Method and Description |
---|---|
static UserRegistryImposition |
UserRegistryImposition.of(Function<? super Registry,? extends Registry> registry)
Creates an imposition of registry returned by the given function.
|
Modifier and Type | Method and Description |
---|---|
static <T> Function<T,java.lang.String> |
Jackson.toJson(Registry registry)
Creates a mapping function that returns the JSON representation as a string of the input object.
|
Modifier and Type | Method and Description |
---|---|
default <T,O> java.util.Optional<O> |
Registry.first(java.lang.Class<T> type,
Function<? super T,? extends O> function)
A convenience method for
Registry.first(TypeToken, Function) . |
default <T,O> java.util.Optional<O> |
Registry.first(com.google.common.reflect.TypeToken<T> type,
Function<? super T,? extends O> function)
Find and transform an item.
|
Modifier and Type | Method and Description |
---|---|
ServerConfigBuilder |
ServerConfigBuilder.env(java.lang.String prefix,
Function<java.lang.String,java.lang.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.
|
Modifier and Type | Method and Description |
---|---|
Event<T> |
Event.data(Function<? super T,java.lang.String> function)
Sets the “data” value of the event to the return value of the given function.
|
Event<T> |
Event.event(Function<? super T,java.lang.String> function)
Sets the “event” value of the event to the return value of the given function.
|
Event<T> |
Event.id(Function<? super T,java.lang.String> function)
Sets the “id” value of the event to the return value of the given function.
|
Modifier and Type | Method and Description |
---|---|
default <O> TransformablePublisher<O> |
TransformablePublisher.flatMap(Function<? super T,? extends Promise<? extends O>> function)
|
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.
|
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.
|
default <O> TransformablePublisher<O> |
TransformablePublisher.map(Function<? super T,? extends O> 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.
|
static <T> TransformablePublisher<T> |
Streams.periodically(Registry registry,
java.time.Duration duration,
Function<? super java.lang.Integer,? extends T> producer) |
static <T> TransformablePublisher<T> |
Streams.periodically(java.util.concurrent.ScheduledExecutorService executorService,
java.time.Duration duration,
Function<? super java.lang.Integer,? extends T> producer)
Executes the given function periodically, publishing the return value to the subscriber.
|
default <O> TransformablePublisher<O> |
TransformablePublisher.streamMap(Function<? super WriteStream<O>,? extends WriteStream<? super T>> function)
Deprecated.
since 1.4, use
TransformablePublisher.streamMap(StreamMapper) |
static <U,D> TransformablePublisher<D> |
Streams.streamMap(Publisher<U> input,
Function<? super WriteStream<D>,? extends WriteStream<? super U>> mapper)
Deprecated.
since 1.4, use
Streams.streamMap(Publisher, StreamMapper) |
static <T> TransformablePublisher<T> |
Streams.yield(Function<? super YieldRequest,? extends T> producer)
Creates a new publisher, backed by the given data producing function.
|
Modifier and Type | Method and 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.
|
Modifier and Type | Method and 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. |
Modifier and Type | Method and Description |
---|---|
static <T> WebSocketConnector<T> |
WebSockets.websocket(Context context,
Function<WebSocket,T> openAction) |