Class ScalarSerializer.Annotated<V>
java.lang.Object
org.spongepowered.configurate.serialize.ScalarSerializer<V>
org.spongepowered.configurate.serialize.ScalarSerializer.Annotated<V>
- Type Parameters:
V- the value to deserialize
- All Implemented Interfaces:
TypeSerializer<V>,TypeSerializer.Annotated<V>
- Enclosing class:
- ScalarSerializer<T>
A specialization of the scalar serializer that favors
annotated type methods over unannotated methods.
- Since:
- 4.2.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.spongepowered.configurate.serialize.ScalarSerializer
ScalarSerializer.Annotated<V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Vdeserialize(AnnotatedType type, Object obj) Given an object of unknown type, attempt to convert it into the given type.deserialize(Type type, Object obj) Given an object of unknown type, attempt to convert it into the given type.Methods inherited from class org.spongepowered.configurate.serialize.ScalarSerializer
deserialize, deserialize, deserialize, serialize, serialize, serialize, serialize, serializeToString, tryDeserialize, typeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.spongepowered.configurate.serialize.TypeSerializer.Annotated
emptyValue, emptyValue
-
Constructor Details
-
Annotated
Create a new annotated scalar serializer that handles the provided type.typemust not be a raw parameterized type.- Parameters:
type- type to handle- Since:
- 4.2.0
-
Annotated
Create a new annotated scalar serializer that handles the provided type.- Parameters:
type- type to handle- Since:
- 4.2.0
-
-
Method Details
-
deserialize
Description copied from class:ScalarSerializerGiven an object of unknown type, attempt to convert it into the given type.- Overrides:
deserializein classScalarSerializer<V>- Parameters:
type- the specific type of the type's usageobj- the object to convert- Returns:
- a converted object
- Throws:
SerializationException- if the object could not be converted for any reason
-
deserialize
Description copied from class:ScalarSerializerGiven an object of unknown type, attempt to convert it into the given type.- Specified by:
deserializein classScalarSerializer<V>- Parameters:
type- the specific type of the type's usageobj- the object to convert- Returns:
- a converted object
- Throws:
SerializationException- if the object could not be converted for any reason
-