I have an entity with java.time.Instant
for created data field:
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode
public
If using Spring, and spring-web
is on the classpath, you can create an ObjectMapper
using the Jackson2ObjectMapperBuilder
. It registers the following commonly used modules within the method registerWellKnownModulesIfAvailable
.
com.fasterxml.jackson.datatype.jdk8.Jdk8Module
com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
com.fasterxml.jackson.datatype.joda.JodaModule
com.fasterxml.jackson.module.kotlin.KotlinModule
Some of these modules have been merged into Jackson 3; see here.