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 SummaryNested classes/interfaces inherited from class org.spongepowered.configurate.serialize.ScalarSerializerScalarSerializer.Annotated<V>
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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.protected abstract Objectserialize(AnnotatedType type, V item, Predicate<Class<?>> typeSupported) Serialize the provided value to a supported type, testing against the provided predicate.protected ObjectSerialize the provided value to a supported type, testing against the provided predicate.Methods inherited from class org.spongepowered.configurate.serialize.ScalarSerializerdeserialize, deserialize, deserialize, serialize, serialize, serializeToString, tryDeserialize, typeMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.spongepowered.configurate.serialize.TypeSerializer.AnnotatedemptyValue, emptyValue
- 
Constructor Details- 
AnnotatedCreate 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
 
- 
AnnotatedCreate a new annotated scalar serializer that handles the provided type.- Parameters:
- type- type to handle
- Since:
- 4.2.0
 
 
- 
- 
Method Details- 
deserializeDescription copied from class:ScalarSerializerGiven an object of unknown type, attempt to convert it into the given type.- Overrides:
- deserializein class- ScalarSerializer<V>
- Parameters:
- type- the specific type of the type's usage
- obj- the object to convert
- Returns:
- a converted object
- Throws:
- SerializationException- if the object could not be converted for any reason
 
- 
deserializeDescription copied from class:ScalarSerializerGiven an object of unknown type, attempt to convert it into the given type.- Specified by:
- deserializein class- ScalarSerializer<V>
- Parameters:
- type- the specific type of the type's usage
- obj- the object to convert
- Returns:
- a converted object
- Throws:
- SerializationException- if the object could not be converted for any reason
 
- 
serializeDescription copied from class:ScalarSerializerSerialize the provided value to a supported type, testing against the provided predicate.Annotated type information is provided for reference. - Overrides:
- serializein class- ScalarSerializer<V>
- Parameters:
- type- the annotated type of the field being serialized
- item- the value to serialize
- typeSupported- a predicate to allow choosing which types are supported
- Returns:
- a serialized form of this object
 
- 
serializeDescription copied from class:ScalarSerializerSerialize the provided value to a supported type, testing against the provided predicate.- Specified by:
- serializein class- ScalarSerializer<V>
- Parameters:
- item- the value to serialize
- typeSupported- a predicate to allow choosing which types are supported
- Returns:
- a serialized form of this object
 
 
-