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.guice |
Integration with Google Guice.
|
ratpack.jackson |
Integration with the Jackson JSON marshalling library.
|
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 |
---|---|
ConfigDataSpec |
ConfigDataSpec.env(String prefix,
Function<String,String> mapFunc)
Adds a configuration source for environment variables starting with the specified prefix.
|
Modifier and Type | Method and Description |
---|---|
<O> Promise<O> |
PromiseOperations.blockingMap(Function<? super T,? extends O> transformer)
Like
PromiseOperations.map(Function) , but performs the transformation on a blocking thread. |
<O> Promise<O> |
PromiseOperations.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.
|
<O> Promise<O> |
PromiseOperations.map(Function<? super T,? extends O> transformer)
Transforms the promised value by applying the given function to it.
|
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 <T> Function<Object,T> |
Function.constant(T t) |
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(Function<I,O> function)
Creates a function of this type from a Guava style function.
|
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.
|
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. |
<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 . |
Modifier and Type | Method and Description |
---|---|
static Function<? super RatpackServer.Definition.Builder,? extends RatpackServer.Definition> |
Groovy.Script.app() |
static Function<? super RatpackServer.Definition.Builder,? extends RatpackServer.Definition> |
Groovy.Script.app(boolean staticCompile) |
static Function<? super RatpackServer.Definition.Builder,? extends RatpackServer.Definition> |
Groovy.Script.app(boolean staticCompile,
String... scriptPaths) |
static Function<? super RatpackServer.Definition.Builder,? extends RatpackServer.Definition> |
Groovy.Script.app(Path script) |
static Function<Registry,Registry> |
Groovy.Script.bindings() |
static Function<Registry,Registry> |
Groovy.Script.bindings(boolean staticCompile) |
static Function<Registry,Registry> |
Groovy.Script.bindings(boolean staticCompile,
String scriptPath) |
static Function<Registry,Handler> |
Groovy.Script.handlers() |
static Function<Registry,Handler> |
Groovy.Script.handlers(boolean staticCompile) |
static Function<Registry,Handler> |
Groovy.Script.handlers(boolean staticCompile,
String scriptPath) |
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 <T> Function<T,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 |
---|---|
Function<? super Registry,? extends Handler> |
RatpackServer.Definition.getHandlerFactory()
The handler factory.
|
Function<? super Registry,? extends Registry> |
RatpackServer.Definition.getUserRegistryFactory()
The user registry.
|
Modifier and Type | Method and Description |
---|---|
RatpackServer.Definition |
RatpackServer.Definition.Builder.handler(Function<? super Registry,? extends Handler> handlerFactory)
Builds the server definition from the given factory, and state of this builder.
|
static RatpackServer |
RatpackServer.of(Function<? super RatpackServer.Definition.Builder,? extends RatpackServer.Definition> definition)
Creates a new, unstarted, Ratpack server from the given function.
|
RatpackServer.Definition.Builder |
RatpackServer.Definition.Builder.registry(Function<? super Registry,? extends Registry> function)
Specifies the user registry.
|
static void |
RatpackServer.start(Function<? super RatpackServer.Definition.Builder,? extends RatpackServer.Definition> serverDefinition)
Convenience method to
define and RatpackServer.start() the server in one go. |
Modifier and Type | Method and Description |
---|---|
Event<T> |
Event.data(Function<? super T,String> function)
Sets the “data” value of the event to the return value of the given function.
|
Event<T> |
Event.event(Function<? super T,String> function)
Sets the “event” value of the event to the return value of the given function.
|
Event<T> |
Event.id(Function<? super T,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(org.reactivestreams.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<? extends 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(org.reactivestreams.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,
Duration duration,
Function<Integer,T> producer) |
static <T> TransformablePublisher<T> |
Streams.periodically(ScheduledExecutorService executorService,
Duration duration,
Function<Integer,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<T>> function)
|
static <I,O> TransformablePublisher<O> |
Streams.streamMap(org.reactivestreams.Publisher<I> input,
Function<? super WriteStream<O>,? extends WriteStream<I>> mapper)
Allows transforming a stream into an entirely different stream.
|
static <T> TransformablePublisher<T> |
Streams.yield(Function<? super YieldRequest,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.
|
static EmbeddedApp |
EmbeddedApp.fromHandlerFactory(Path baseDir,
Function<? super Registry,? extends Handler> handlerFactory)
Creates an embedded application with a default launch config (ephemeral port) and the given handler.
|
static EmbeddedApp |
EmbeddedApp.fromServer(ServerConfig serverConfig,
Function<? super RatpackServer.Definition.Builder,? extends RatpackServer.Definition> builder)
Creates an embedded application using the given server config, and server creating function.
|
static EmbeddedApp |
EmbeddedApp.of(Function<? super RatpackServer.Definition.Builder,? extends RatpackServer.Definition> definition)
Creates an embedded application from the given function.
|
static EmbeddedApp |
EmbeddedApp.of(Path baseDir,
Function<? super RatpackServer.Definition.Builder,? extends RatpackServer.Definition> definition) |
Modifier and Type | Method and Description |
---|---|
<T> ExecResult<T> |
ExecHarness.yield(Function<ExecControl,Promise<T>> func)
Synchronously returns a promised value.
|
static <T> ExecResult<T> |
ExecHarness.yieldSingle(Function<ExecControl,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) |