@Override
    public AttributeValue marshall(Object obj) {
        String string = (String) obj;
        if (string.length() == 0) {
            // Sticking with the legacy behavior for now.
            return null;
        }

        return new AttributeValue().withS(string);
    }
A marshaller that marshals Java {@code String} objects to DynamoDB Strings.
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/marshallers/StringToStringMarshaller.java