com.vladmihalcea.hibernate.type.util
Class ObjectMapperWrapper

java.lang.Object
  extended by com.vladmihalcea.hibernate.type.util.ObjectMapperWrapper

public class ObjectMapperWrapper
extends Object

Wraps a Jackson ObjectMapper so that you can supply your own ObjectMapper reference.

Since:
2.1.0
Author:
Vlad Mihalcea

Field Summary
static ObjectMapperWrapper INSTANCE
           
 
Constructor Summary
ObjectMapperWrapper()
           
ObjectMapperWrapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
           
 
Method Summary
<T> T
clone(T value)
           
<T> T
fromBytes(byte[] value, Class<T> clazz)
           
<T> T
fromBytes(byte[] value, Type type)
           
<T> T
fromString(String string, Class<T> clazz)
           
<T> T
fromString(String string, Type type)
           
 com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
           
 void setJsonSerializer(JsonSerializer jsonSerializer)
           
 byte[] toBytes(Object value)
           
 com.fasterxml.jackson.databind.JsonNode toJsonNode(String value)
           
 String toString(Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final ObjectMapperWrapper INSTANCE
Constructor Detail

ObjectMapperWrapper

public ObjectMapperWrapper()

ObjectMapperWrapper

public ObjectMapperWrapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Method Detail

setJsonSerializer

public void setJsonSerializer(JsonSerializer jsonSerializer)

getObjectMapper

public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()

fromString

public <T> T fromString(String string,
                        Class<T> clazz)

fromString

public <T> T fromString(String string,
                        Type type)

fromBytes

public <T> T fromBytes(byte[] value,
                       Class<T> clazz)

fromBytes

public <T> T fromBytes(byte[] value,
                       Type type)

toString

public String toString(Object value)

toBytes

public byte[] toBytes(Object value)

toJsonNode

public com.fasterxml.jackson.databind.JsonNode toJsonNode(String value)

clone

public <T> T clone(T value)


Copyright © 2020. All rights reserved.