Class AbstractEnumMarshaller<T extends Enum<T>>
- java.lang.Object
-
- com.amazonaws.services.dynamodbv2.datamodeling.AbstractEnumMarshaller<T>
-
- All Implemented Interfaces:
DynamoDBMarshaller<T>
public abstract class AbstractEnumMarshaller<T extends Enum<T>> extends Object implements DynamoDBMarshaller<T>
Generic marshaller for enumerations. Please note, there are some risks in distributed systems when using enumerations as attributes intead of simply using a String. When adding new values to the enumeration, the enum only changes must be deployed before the enumeration value can be persisted. This will ensure that all systems have the correct code to map it from the item record in DynamoDB to your objects.- See Also:
DynamoDBMarshaller
-
-
Constructor Summary
Constructors Constructor Description AbstractEnumMarshaller()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
marshall(T obj)
Turns an object of type T into its String representation.T
unmarshall(Class<T> clazz, String obj)
Turns a String representation of an object of type T into an object.
-
-
-
Method Detail
-
marshall
public String marshall(T obj)
Turns an object of type T into its String representation.- Specified by:
marshall
in interfaceDynamoDBMarshaller<T extends Enum<T>>
-
unmarshall
public T unmarshall(Class<T> clazz, String obj)
Turns a String representation of an object of type T into an object.- Specified by:
unmarshall
in interfaceDynamoDBMarshaller<T extends Enum<T>>
-
-