Class UUIDSerializer
java.lang.Object
tech.guilhermekaua.spigotboot.config.serialization.scalars.UUIDSerializer
- All Implemented Interfaces:
TypeSerializer<UUID>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this serializer can handle the given type.deserialize(@NotNull ConfigNode node, @NotNull Class<UUID> type) Deserializes a configuration node to the target type.voidserialize(@NotNull UUID value, @NotNull MutableConfigNode node) Serializes a value to a configuration node.
-
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:TypeSerializerDeserializes a configuration node to the target type.- Specified by:
deserializein interfaceTypeSerializer<UUID>- Parameters:
node- the source nodetype- 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:TypeSerializerSerializes a value to a configuration node.- Specified by:
serializein interfaceTypeSerializer<UUID>- Parameters:
value- the value to serializenode- the target node- Throws:
SerializationException- if serialization fails
-
canHandle
Description copied from interface:TypeSerializerChecks 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:
canHandlein interfaceTypeSerializer<UUID>- Parameters:
type- the type to check- Returns:
- true if this serializer can handle the type
-