Class SerializerRegistry
java.lang.Object
co.crystaldev.alpinecore.framework.storage.SerializerRegistry
Central registry for managing serializers in the application.
- Since:
- 0.1.2
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@Nullable KeySerializer<?,
?> getKeySerializer
(@NotNull Class<?> dataType) Retrieves a key serializer for the specified data type.void
putConfigSerializer
(@NotNull Class<?> dataType, @NotNull de.exlll.configlib.Serializer<?, ?> serializer) Registers a custom config serializer for a specific data type.void
putKeySerializer
(@NotNull Class<?> dataType, @NotNull KeySerializer<?, ?> serializer) Registers a custom key serializer for a specific data type.
-
Constructor Details
-
SerializerRegistry
public SerializerRegistry()
-
-
Method Details
-
putKeySerializer
public void putKeySerializer(@NotNull @NotNull Class<?> dataType, @NotNull @NotNull KeySerializer<?, ?> serializer) Registers a custom key serializer for a specific data type.- Parameters:
dataType
- The data type for which the serializer is registered.serializer
- The custom key serializer.
-
putConfigSerializer
public void putConfigSerializer(@NotNull @NotNull Class<?> dataType, @NotNull @NotNull de.exlll.configlib.Serializer<?, ?> serializer) Registers a custom config serializer for a specific data type.- Parameters:
dataType
- The data type for which the serializer is registered.serializer
- The custom config serializer.
-
getKeySerializer
Retrieves a key serializer for the specified data type.- Parameters:
dataType
- The data type for which to retrieve the key serializer.- Returns:
- The key serializer associated with the data type, or null if not found.
-