Code example for JsonPrimitive

0
    } 
 
    public static class IdentifierTypeSerializer implements JsonSerializer<IdentifierType> {
        @Override 
        public JsonElement serialize(IdentifierType src, Type typeOfSrc, JsonSerializationContext context) {
            return new JsonPrimitive(src.getUuid());
        } 
    } 
}