C - The type of the config instancepublic class TypeSerializerList<C>
extends java.lang.Object
Object is a passthrough serializer that just returns the value without any changes.| Constructor and Description |
|---|
TypeSerializerList() |
| Modifier and Type | Method and Description |
|---|---|
<T> void |
add(java.lang.Class<T> type,
java.util.function.Function<C,ConfigTypeSerializer<C,T>> serializerSupplier)
Add a new type serializer to the list.
|
<T> ConfigTypeSerializer<C,T> |
get(C config,
java.lang.Class<T> type)
Get a type serializer for the given type.
|
public <T> void add(java.lang.Class<T> type,
java.util.function.Function<C,ConfigTypeSerializer<C,T>> serializerSupplier)
T - The type of the serializertype - The type to add the serializer forserializerSupplier - The supplier for the serializerpublic <T> ConfigTypeSerializer<C,T> get(@Nullable C config, java.lang.Class<T> type)
T - The type of the serializerconfig - The config instance (null if the config is static)type - The type to get the serializer for