Class SerializerRegistry

java.lang.Object
co.crystaldev.alpinecore.framework.storage.SerializerRegistry

public final class SerializerRegistry extends Object
Central registry for managing serializers in the application.
Since:
0.1.2
  • 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

      @Nullable public @Nullable KeySerializer<?,?> getKeySerializer(@NotNull @NotNull Class<?> dataType)
      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.