Interface JacksonCompat.ObjectMapperAccessor
- Enclosing class:
- JacksonCompat
public static interface JacksonCompat.ObjectMapperAccessor
Accessor for
ObjectMapper that provides methods to serialize and
deserialize JSON.-
Method Summary
Modifier and TypeMethodDescriptioncreate()Create an accessor using the default mapper configuration of the active strategy.<I> Ideserialize(Object json, Class<I> type) Deserialize JSON content to the requested target type.from(VaultOperations vaultOperations) Create an accessor from the givenVaultOperationscontext.writeValueAsString(Object object) Serialize the given object to its JSON string representation.
-
Method Details
-
create
Create an accessor using the default mapper configuration of the active strategy.- Returns:
- a default
JacksonCompat.ObjectMapperAccessor.
-
from
Create an accessor from the givenVaultOperationscontext.If a
RestTemplatewith a compatible Jackson converter is available, that converter's mapper is used. Otherwise, this method falls back tocreate().- Parameters:
vaultOperations- the operations used to access the current Vault session.- Returns:
- an
JacksonCompat.ObjectMapperAccessorfor the current session context.
-
deserialize
Deserialize JSON content to the requested target type.- Parameters:
json- must not be null.type- must not be null.- Returns:
- the deserialized object.
-
writeValueAsString
Serialize the given object to its JSON string representation.- Parameters:
object- the object to serialize.- Returns:
- the JSON string representation.
-