Class JavaEnumSchema<T extends Enum<T>>
java.lang.Object
dev.drtheo.autojson.schema.template.JavaEnumSchema<T>
- All Implemented Interfaces:
PrimitiveSchema<T>,Schema<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<To> Tdeserialize(JsonAdapter<Object, To> auto, JsonDeserializationContext c) <To> voidserialize(JsonAdapter<Object, To> auto, JsonSerializationContext.Primitive c, T anEnum) static <T,E extends Enum<E>>
JavaEnumSchema<E>Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.drtheo.autojson.schema.base.PrimitiveSchema
serialize, typeMethods inherited from interface dev.drtheo.autojson.schema.base.Schema
asArray, asObject, asPrimitive
-
Constructor Details
-
JavaEnumSchema
-
-
Method Details
-
unwrap
-
serialize
public <To> void serialize(JsonAdapter<Object, To> auto, JsonSerializationContext.Primitive c, T anEnum) - Specified by:
serializein interfacePrimitiveSchema<T extends Enum<T>>- Type Parameters:
To- the type the adapter serializes to.- Parameters:
auto- the adapter used to serialize this object.c- the serialization context. Used to provide the value.anEnum- the object you're serializing.
-
deserialize
- Specified by:
deserializein interfacePrimitiveSchema<T extends Enum<T>>- Type Parameters:
To- whatever the adapter's serializing to.- Parameters:
auto- the adapter used to deserialize this object.c- the deserialization context. Used to query the deserialization.- Returns:
- The deserialized object.
-