Class AttributeTransformerChain
- java.lang.Object
-
- com.amazonaws.services.dynamodbv2.datamodeling.AttributeTransformerChain
-
- All Implemented Interfaces:
AttributeTransformer
public class AttributeTransformerChain extends Object implements AttributeTransformer
A virtualAttributeTransformerthat transforms and untransforms attributes by running them through a cascading series of childAttributeTransformerinstances.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.amazonaws.services.dynamodbv2.datamodeling.AttributeTransformer
AttributeTransformer.Parameters<T>
-
-
Constructor Summary
Constructors Constructor Description AttributeTransformerChain(AttributeTransformer... transformers)Creates a new transformer chain from the given array of transformers.AttributeTransformerChain(List<AttributeTransformer> transformers)Creates a new transformer chain from the given list of transformers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<AttributeTransformer>getTransformers()StringtoString()Map<String,AttributeValue>transform(AttributeTransformer.Parameters<?> parameters)Transforms the input set of attribute values derived from the model object before writing them into DynamoDB.Map<String,AttributeValue>untransform(AttributeTransformer.Parameters<?> parameters)Untransform the input set of attribute values read from DynamoDB before creating a model object from them.
-
-
-
Constructor Detail
-
AttributeTransformerChain
public AttributeTransformerChain(AttributeTransformer... transformers)
Creates a new transformer chain from the given array of transformers. When transforming attributes, these transformers are invoked from first to last; when untransforming they are invoked in the opposite order.- Parameters:
transformers- the chain of transformers.
-
AttributeTransformerChain
public AttributeTransformerChain(List<AttributeTransformer> transformers)
Creates a new transformer chain from the given list of transformers. When transforming attributes, these transformers are invoked from first to last; when untransforming they are invoked in the opposite order.- Parameters:
transformers- the chain of transformers.
-
-
Method Detail
-
getTransformers
public List<AttributeTransformer> getTransformers()
- Returns:
- the transformers in this chain
-
transform
public Map<String,AttributeValue> transform(AttributeTransformer.Parameters<?> parameters)
Description copied from interface:AttributeTransformerTransforms the input set of attribute values derived from the model object before writing them into DynamoDB.- Specified by:
transformin interfaceAttributeTransformer- Parameters:
parameters- transformation parameters- Returns:
- the transformed attribute value map
-
untransform
public Map<String,AttributeValue> untransform(AttributeTransformer.Parameters<?> parameters)
Description copied from interface:AttributeTransformerUntransform the input set of attribute values read from DynamoDB before creating a model object from them.- Specified by:
untransformin interfaceAttributeTransformer- Parameters:
parameters- transformation parameters- Returns:
- the untransformed attribute value map
-
-