Code example for JsonPrimitive

0
    } 
 
    public static class RoleSerializer implements JsonSerializer<Role> {
        @Override 
        public JsonElement serialize(Role src, Type typeOfSrc, JsonSerializationContext context) {
            return new JsonPrimitive(src.getUuid());
        } 
    } 
} 
Experience pair programming with AI  Get Codota for Java