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>
public abstract static class ScalarSerializer.Annotated<V> extends ScalarSerializer<V>
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 Modifier Constructor Description protected
Annotated(io.leangen.geantyref.TypeToken<V> type)
Create a new annotated scalar serializer that handles the provided type.protected
Annotated(java.lang.Class<V> type)
Create a new annotated scalar serializer that handles the provided type.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract V
deserialize(java.lang.reflect.AnnotatedType type, java.lang.Object obj)
Given an object of unknown type, attempt to convert it into the given type.V
deserialize(java.lang.reflect.Type type, java.lang.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, serializeToString, tryDeserialize, type
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.spongepowered.configurate.serialize.TypeSerializer.Annotated
emptyValue, emptyValue
-
-
-
-
Method Detail
-
deserialize
public abstract V deserialize(java.lang.reflect.AnnotatedType type, java.lang.Object obj) throws SerializationException
Description copied from class:ScalarSerializer
Given an object of unknown type, attempt to convert it into the given type.- Overrides:
deserialize
in 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
public V deserialize(java.lang.reflect.Type type, java.lang.Object obj) throws SerializationException
Description copied from class:ScalarSerializer
Given an object of unknown type, attempt to convert it into the given type.- Specified by:
deserialize
in 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
-
-