Warning: Undefined array key "HTTP_REFERER" in /home/u522501990/domains/makemeengr.com/public_html/wp-content/themes/generatepress/generatepress.theme#archive on line 43

Using Jackson ObjectMapper with Java 8 Optional values

You could use jackson-datatype-jdk8 which is described as:

Support for new JDK8-specific types, such as Optional

In order to do this:

  • add com.fasterxml.jackson.datatype:jackson-datatype-jdk8 as a dependency
  • register the module with your object mapper: objectMapper.registerModule(new Jdk8Module());

Leave a Comment

techhipbettruvabetnorabahisbahis forumutaraftarium24eduseduseduseduedusedusedueduedusedus