Code example for JsonPrimitive

0
public class AccessKeySerializer implements JsonSerializer<AccessKey> { 
 
    @Override 
    public JsonElement serialize(final AccessKey src, final Type type, final JsonSerializationContext jsonSerializationContext) { 
        final String j = GsonFactory.getSimpleInstance().toJson(src); 
        return new JsonPrimitive(j); 
    } 
}