public final class UserRegistryImposition extends java.lang.Object implements Imposition
If present, the imposed registry will be joined with the user registry specified by RatpackServerSpec.registry(Function)
.
This effectively allows adding extra things to the registry.
Impositions
Modifier and Type | Method and Description |
---|---|
Registry |
build(Registry userRegistry)
Returns the registry of additions, taking the original user registry as the argument
|
static UserRegistryImposition |
none()
Creates an imposition of an empty registry.
|
static UserRegistryImposition |
of(Function<? super Registry,? extends Registry> registry)
Creates an imposition of registry returned by the given function.
|
static UserRegistryImposition |
of(Registry registry)
Creates an imposition of the given registry.
|
public static UserRegistryImposition none()
This is equivalent to their being no imposition at all.
public static UserRegistryImposition of(Registry registry)
registry
- the registry to join with the user registrypublic static UserRegistryImposition of(Function<? super Registry,? extends Registry> registry)
The given function receives the user registry as input. The function should not return a registry that has been joined with the input. The user registry is given as input to allow retrieval from the registry.
registry
- a function that receives the user registry and returns a registry of additions to it