Interface AttributeTransformer
-
- All Known Implementing Classes:
AttributeTransformerChain
public interface AttributeTransformer
A hook allowing a custom transform/untransform of the raw attribute values immediately before writing them into DynamoDB and immediately after reading them out of DynamoDB, but with extra context about the model class not available at the raw AmazonDynamoDB level.This interface contains both a
transform
method and a correspondinguntransform
method. These methods SHOULD be inverses, such that untransform(transform(value)) == value.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
AttributeTransformer.Parameters<T>
Parameters for thetransform
anduntransform
methods, so we don't have to break the interface in order to add additional parameters.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.
-
-
-
Method Detail
-
transform
Map<String,AttributeValue> transform(AttributeTransformer.Parameters<?> parameters)
Transforms the input set of attribute values derived from the model object before writing them into DynamoDB.- Parameters:
parameters
- transformation parameters- Returns:
- the transformed attribute value map
-
untransform
Map<String,AttributeValue> untransform(AttributeTransformer.Parameters<?> parameters)
Untransform the input set of attribute values read from DynamoDB before creating a model object from them.- Parameters:
parameters
- transformation parameters- Returns:
- the untransformed attribute value map
-
-