Contents
Interface IMetaRegistry<K>
- All Known Implementing Classes:
MetaRegistry
public interface IMetaRegistry<K>
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidforEachMetaEntry(IMetaStore<K> store, IMetaRegistry.MetaEntryConsumer consumer) getMetaKeyForCodecKey(String codecKey) <T> TnewMetaObject(MetaKey<T> key, K holder) Returns a new instance of the associated meta object which is created from the Supplier passed in the register method.default <T> MetaKey<T> Registers meta object with a null initializerdefault <T> MetaKey<T> registerMetaObject(Function<K, T> supplier) This is used to create a new meta object and returns the integer id to lookup the object.<T> MetaKey<T> registerMetaObject(Function<K, T> function, boolean persistent, String keyName, Codec<T> codec) This is used to create a new meta object and returns the integer id to lookup the objectdefault <T> MetaKey<T> registerMetaObject(Function<K, T> supplier, String keyName, Codec<T> codec) This is used to create a new meta object and returns the integer id to lookup the object.
-
Method Details
-
newMetaObject
Returns a new instance of the associated meta object which is created from the Supplier passed in the register method.- Type Parameters:
T- Type of the returned object- Parameters:
key- Metakey from #register(Supplier).- Returns:
- New instance of Meta object
- Throws:
IllegalArgumentException- Thrown if the object is not registered
-
forEachMetaEntry
-
getMetaKeyForCodecKey
-
registerMetaObject
<T> MetaKey<T> registerMetaObject(Function<K, T> function, boolean persistent, String keyName, Codec<T> codec) This is used to create a new meta object and returns the integer id to lookup the object- Parameters:
function- Supplier used to create a new object when a world has no instancepersistent- True if meta value is persistentkeyName- Key name of this codeccodec- Codec to encode this type. Generally a KeyedCodec- Returns:
- MetaKey to lookup the meta object
-
registerMetaObject
This is used to create a new meta object and returns the integer id to lookup the object. It is marked as persistent on default.- Parameters:
supplier- Supplier used to create a new object when a world has no instancekeyName- Key name of this codeccodec- Codec to encode this type. Generally a KeyedCodec- Returns:
- MetaKey to lookup the meta object
-
registerMetaObject
This is used to create a new meta object and returns the integer id to lookup the object. The meta value is always non-persistent- Parameters:
supplier- Supplier used to create a new object when a world has no instance- Returns:
- MetaKey to lookup the meta object
-
registerMetaObject
Registers meta object with a null initializer- Type Parameters:
T- Type of the object- Returns:
- MetaKey to lookup the meta object
-