public interface RegistrySpec
RegistryBuilder| Modifier and Type | Method and Description |
|---|---|
default <O> RegistrySpec |
add(java.lang.Class<O> type,
O object)
Adds a registry entry that is available by the given type.
|
default RegistrySpec |
add(java.lang.Object object)
Adds a registry entry.
|
default <O> RegistrySpec |
add(com.google.common.reflect.TypeToken<O> type,
O object)
Adds a registry entry that is available by the given type.
|
default <O> RegistrySpec |
addLazy(java.lang.Class<O> type,
java.util.function.Supplier<? extends O> supplier)
Adds a lazily created entry to the registry.
|
<O> RegistrySpec |
addLazy(com.google.common.reflect.TypeToken<O> type,
java.util.function.Supplier<? extends O> supplier)
Adds a lazily created entry to the registry.
|
default RegistrySpec |
with(Action<? super RegistrySpec> action)
Executes the given action with
this. |
default <O> RegistrySpec add(java.lang.Class<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(com.google.common.reflect.TypeToken<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(java.lang.Object object)
object - the object to add to the registrydefault <O> RegistrySpec addLazy(java.lang.Class<O> type, java.util.function.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(com.google.common.reflect.TypeToken<O> type, java.util.function.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 RegistrySpec with(Action<? super RegistrySpec> action) throws java.lang.Exception
this.action - the actionthisjava.lang.Exception - any thrown by action