java.lang.Object
tech.guilhermekaua.spigotboot.config.serialization.scalars.UUIDSerializer
All Implemented Interfaces:
TypeSerializer<UUID>

public class UUIDSerializer extends Object implements TypeSerializer<UUID>
  • Constructor Details

    • UUIDSerializer

      public UUIDSerializer()
  • Method Details

    • deserialize

      public UUID deserialize(@NotNull @NotNull ConfigNode node, @NotNull @NotNull Class<UUID> type) throws SerializationException
      Description copied from interface: TypeSerializer
      Deserializes a configuration node to the target type.
      Specified by:
      deserialize in interface TypeSerializer<UUID>
      Parameters:
      node - the source node
      type - the target type class
      Returns:
      the deserialized value
      Throws:
      SerializationException - if deserialization fails
    • serialize

      public void serialize(@NotNull @NotNull UUID value, @NotNull @NotNull MutableConfigNode node) throws SerializationException
      Description copied from interface: TypeSerializer
      Serializes a value to a configuration node.
      Specified by:
      serialize in interface TypeSerializer<UUID>
      Parameters:
      value - the value to serialize
      node - the target node
      Throws:
      SerializationException - if serialization fails
    • canHandle

      public boolean canHandle(@NotNull @NotNull Class<?> type)
      Description copied from interface: TypeSerializer
      Checks if this serializer can handle the given type.

      Used for dynamic serializer selection when the exact type is not registered but a compatible serializer exists.

      Specified by:
      canHandle in interface TypeSerializer<UUID>
      Parameters:
      type - the type to check
      Returns:
      true if this serializer can handle the type