Java Jackson facultatif
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new Jdk8Module());
String jsonString = mapper.writeValueAsString(optionalObject);
Outstanding Owl