Interface TypeSerializer.Annotated<V>
- Type Parameters:
V- the value type
- All Superinterfaces:
TypeSerializer<V>
- All Known Implementing Classes:
AbstractListChildSerializer,ScalarSerializer,ScalarSerializer.Annotated
- Enclosing interface:
- TypeSerializer<T>
A type serializer that prefers type use annotation metadata to
deserialize the type.
- Since:
- 4.2.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.spongepowered.configurate.serialize.TypeSerializer
TypeSerializer.Annotated<V> -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(AnnotatedType type, ConfigurationNode node) Deserialize an object (of the correct type) from the given configuration node.default Vdeserialize(Type type, ConfigurationNode node) Deserialize an object (of the correct type) from the given configuration node.default @Nullable VemptyValue(AnnotatedType specificType, ConfigurationOptions options) Create an empty value of the appropriate type.default @Nullable VemptyValue(Type specificType, ConfigurationOptions options) Create an empty value of the appropriate type.voidserialize(AnnotatedType type, @Nullable V obj, ConfigurationNode node) Serialize an object to the given configuration node.default voidserialize(Type type, @Nullable V obj, ConfigurationNode node) Serialize an object to the given configuration node.
-
Method Details
-
deserialize
Description copied from interface:TypeSerializerDeserialize an object (of the correct type) from the given configuration node.- Specified by:
deserializein interfaceTypeSerializer<V>- Parameters:
type- the annotated type of return value requirednode- the node containing serialized data- Returns:
- an object
- Throws:
SerializationException- if the presented data is invalid
-
deserialize
Description copied from interface:TypeSerializerDeserialize an object (of the correct type) from the given configuration node.- Specified by:
deserializein interfaceTypeSerializer<V>- Parameters:
type- the type of return value requirednode- the node containing serialized data- Returns:
- an object
- Throws:
SerializationException- if the presented data is invalid
-
serialize
void serialize(AnnotatedType type, @Nullable V obj, ConfigurationNode node) throws SerializationException Description copied from interface:TypeSerializerSerialize an object to the given configuration node.- Specified by:
serializein interfaceTypeSerializer<V>- Parameters:
type- the annotated type of the input objectobj- the object to be serializednode- the node to write to- Throws:
SerializationException- if the object cannot be serialized
-
serialize
default void serialize(Type type, @Nullable V obj, ConfigurationNode node) throws SerializationException Description copied from interface:TypeSerializerSerialize an object to the given configuration node.- Specified by:
serializein interfaceTypeSerializer<V>- Parameters:
type- the type of the input objectobj- the object to be serializednode- the node to write to- Throws:
SerializationException- if the object cannot be serialized
-
emptyValue
Description copied from interface:TypeSerializerCreate an empty value of the appropriate type.This method is for the most part designed to create empty collection types, though it may be useful for scalars in limited cases.
- Specified by:
emptyValuein interfaceTypeSerializer<V>- Parameters:
specificType- specific annotated subtype to create an empty value ofoptions- options used from the loading node- Returns:
- new empty value
-
emptyValue
Description copied from interface:TypeSerializerCreate an empty value of the appropriate type.This method is for the most part designed to create empty collection types, though it may be useful for scalars in limited cases.
- Specified by:
emptyValuein interfaceTypeSerializer<V>- Parameters:
specificType- specific subtype to create an empty value ofoptions- options used from the loading node- Returns:
- new empty value
-