public abstract class Registries extends Object
registries.| Modifier and Type | Method and Description |
|---|---|
static Registry |
backedRegistry(RegistryBacking registryBacking)
Creates a new registry instance that is backed by a RegistryBacking implementation.
|
static Registry |
empty()
Returns an empty registry.
|
static <T> Registry |
just(Class<? super T> publicType,
T implementation)
Creates a single entry registry, using
RegistryBuilder.add(Class, Object). |
static <T> Registry |
just(Class<T> publicType,
Supplier<? extends T> supplier)
Creates a single lazily created entry registry, using
RegistryBuilder.addLazy(Class, Supplier). |
static Registry |
just(Object object)
Creates a single entry registry, using
RegistryBuilder.add(Object). |
static RegistryBuilder |
registry()
Creates a new
registry builder. |
static Registry |
registry(Action<? super RegistrySpec> action)
Builds a registry from the given action.
|
public static <T> Registry just(Class<T> publicType, Supplier<? extends T> supplier)
RegistryBuilder.addLazy(Class, Supplier).T - the public type of the entrypublicType - the public type of the entrysupplier - the supplier for the objectRegistryBuilder.addLazy(Class, Supplier)public static Registry just(Object object)
RegistryBuilder.add(Object).object - the entry objectRegistryBuilder.add(java.lang.Object)public static <T> Registry just(Class<? super T> publicType, T implementation)
RegistryBuilder.add(Class, Object).T - the public type of the entrypublicType - the public type of the entryimplementation - the entry objectRegistryBuilder.add(Class, Object)public static RegistryBuilder registry()
registry builder.RegistryBuilderpublic static Registry empty()
public static Registry registry(Action<? super RegistrySpec> action) throws Exception
action - the action that defines the registryException - any thrown by the actionpublic static Registry backedRegistry(RegistryBacking registryBacking)
registryBacking - the implementation that returns instances for the registry