public interface RegistrySpec
RegistryBuilder
Modifier and Type | Method and Description |
---|---|
default <O> RegistrySpec |
add(Class<? super O> type,
O object)
Adds a registry entry that is available by the given type.
|
default RegistrySpec |
add(Object object)
Adds a registry entry.
|
default <O> RegistrySpec |
add(TypeToken<? super O> type,
O object)
Adds a registry entry that is available by the given type.
|
default <O> RegistrySpec |
addLazy(Class<O> type,
Supplier<? extends O> supplier)
Adds a lazily created entry to the registry.
|
<O> RegistrySpec |
addLazy(TypeToken<O> type,
Supplier<? extends O> supplier)
Adds a lazily created entry to the registry.
|
default <O> RegistrySpec |
addLazyAsync(Class<O> type,
Supplier<? extends Promise<? extends O>> supplier) |
default <O> RegistrySpec |
addLazyAsync(TypeToken<O> type,
Supplier<? extends Promise<? extends O>> supplier) |
default RegistrySpec |
with(Action<? super RegistrySpec> action)
Executes the given action with
this . |
default <O> RegistrySpec add(Class<? super O> type, O object)
O
- the public type of the registry entrytype
- the public type of the registry entryobject
- the actual registry entrydefault <O> RegistrySpec add(TypeToken<? super O> type, O object)
O
- the public type of the registry entrytype
- the public type of the registry entryobject
- the actual registry entrydefault RegistrySpec add(Object object)
object
- the object to add to the registrydefault <O> RegistrySpec addLazy(Class<O> type, Supplier<? extends O> supplier)
The supplier will be invoked exactly once, when a query is made to the registry of a compatible type of the given type.
O
- the public type of the registry entrytype
- the public type of the registry entrysupplier
- the supplier for creating the object when needed<O> RegistrySpec addLazy(TypeToken<O> type, Supplier<? extends O> supplier)
The supplier will be invoked exactly once, when a query is made to the registry of a compatible type of the given type.
O
- the public type of the registry entrytype
- the public type of the registry entrysupplier
- the supplier for creating the object when neededdefault <O> RegistrySpec addLazyAsync(Class<O> type, Supplier<? extends Promise<? extends O>> supplier)
default <O> RegistrySpec addLazyAsync(TypeToken<O> type, Supplier<? extends Promise<? extends O>> supplier)
default RegistrySpec with(Action<? super RegistrySpec> action) throws Exception
this
.action
- the actionthis
Exception
- any thrown by action