Skip to content

Instantly share code, notes, and snippets.

@igorzg
Created March 24, 2017 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igorzg/fcd3d5391cefc435f3411438aba745a1 to your computer and use it in GitHub Desktop.
Save igorzg/fcd3d5391cefc435f3411438aba745a1 to your computer and use it in GitHub Desktop.
Dynamodb dynamic low level api map converter
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTypeConverter;
import com.amazonaws.services.dynamodbv2.document.internal.InternalUtils;
import com.amazonaws.services.dynamodbv2.model.AttributeValue;
import java.util.Map;
public class DynamicStructure implements DynamoDBTypeConverter<Map<String, AttributeValue>, Map<String, Object>> {
@Override
public Map<String, AttributeValue> convert(Map<String, Object> object) {
return InternalUtils.fromSimpleMap(object);
}
@Override
public Map<String, Object> unconvert(Map<String, AttributeValue> object) {
return InternalUtils.toSimpleMapValue(object);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment