Package software.amazon.awssdk.iot
Class EnumSerializer<E>
- java.lang.Object
- 
- software.amazon.awssdk.iot.EnumSerializer<E>
 
- 
- Type Parameters:
- E- the enumeration type the serializer should work with
 - All Implemented Interfaces:
- com.google.gson.JsonDeserializer<E>,- com.google.gson.JsonSerializer<E>
 
 public class EnumSerializer<E> extends Object implements com.google.gson.JsonSerializer<E>, com.google.gson.JsonDeserializer<E> Custom JSON serializer for enumerated types within IoT service models
- 
- 
Constructor SummaryConstructors Constructor Description EnumSerializer()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Edeserialize(com.google.gson.JsonElement json, Type typeOfEnum, com.google.gson.JsonDeserializationContext context)Deserializes the JsonElement to an enumcom.google.gson.JsonElementserialize(E enumValue, Type typeOfEnum, com.google.gson.JsonSerializationContext context)Serializes the given enum to a JsonElement
 
- 
- 
- 
Method Detail- 
serializepublic com.google.gson.JsonElement serialize(E enumValue, Type typeOfEnum, com.google.gson.JsonSerializationContext context) Serializes the given enum to a JsonElement- Specified by:
- serializein interface- com.google.gson.JsonSerializer<E>
- Parameters:
- enumValue- The enum to convert
- typeOfEnum- The enum to convert type
- context- The JsonSerializationContext to use
- Returns:
- The enum as a JsonElement
 
 - 
deserializepublic E deserialize(com.google.gson.JsonElement json, Type typeOfEnum, com.google.gson.JsonDeserializationContext context) throws com.google.gson.JsonParseException Deserializes the JsonElement to an enum- Specified by:
- deserializein interface- com.google.gson.JsonDeserializer<E>
- Parameters:
- json- The json to convert
- typeOfEnum- The type of enum to convert to
- context- The JsonDeserializationContext to use
- Returns:
- The enum from the JsonElement data
- Throws:
- com.google.gson.JsonParseException
 
 
- 
 
-