@Stability.Internal public class Mapper extends Object
Modifier and Type | Method and Description |
---|---|
static <T> T |
convertValue(Object fromValue,
Class<T> toValueType)
Converts an object to the requested type using
ObjectMapper.convertValue(Object, Class) . |
static <T> T |
convertValue(Object fromValue,
com.couchbase.client.core.deps.com.fasterxml.jackson.core.type.TypeReference<T> toValueTypeRef)
Converts an object to the requested type using
ObjectMapper.convertValue(Object, TypeReference) . |
static com.couchbase.client.core.deps.com.fasterxml.jackson.databind.node.ArrayNode |
createArrayNode()
Returns a new empty ArrayNode.
|
static com.couchbase.client.core.deps.com.fasterxml.jackson.databind.node.ObjectNode |
createObjectNode()
Returns a new empty ObjectNode.
|
static <T> T |
decodeInto(byte[] input,
Class<T> clazz)
Decodes a byte array into the given class.
|
static <T> T |
decodeInto(byte[] input,
com.couchbase.client.core.deps.com.fasterxml.jackson.core.type.TypeReference<T> type)
Decodes a byte array into the given type.
|
static <T> T |
decodeInto(String input,
Class<T> clazz)
Decodes a String into the given class.
|
static <T> T |
decodeInto(String input,
com.couchbase.client.core.deps.com.fasterxml.jackson.core.type.TypeReference<T> type)
Decodes a String into the given type.
|
static com.couchbase.client.core.deps.com.fasterxml.jackson.databind.JsonNode |
decodeIntoTree(byte[] input)
Decodes a byte array into a tree of JSON nodes.
|
static byte[] |
encodeAsBytes(Object input)
Encodes the given input into a byte array, formatted non-pretty.
|
static byte[] |
encodeAsBytesPretty(Object input)
Encodes the given input into a byte array, formatted pretty.
|
static String |
encodeAsString(Object input)
Encodes the given input into a String, formatted non-pretty.
|
static String |
encodeAsStringPretty(Object input)
Encodes the given input into a String, formatted pretty.
|
static com.couchbase.client.core.deps.com.fasterxml.jackson.databind.ObjectReader |
reader()
Returns an ObjectReader for advanced use cases.
|
static com.couchbase.client.core.deps.com.fasterxml.jackson.databind.ObjectWriter |
writer()
Returns an ObjectWriter for advanced use cases.
|
public static byte[] encodeAsBytes(Object input)
input
- the java object as inputpublic static byte[] encodeAsBytesPretty(Object input)
input
- the java object as inputpublic static String encodeAsString(Object input)
input
- the java object as inputpublic static String encodeAsStringPretty(Object input)
input
- the java object as inputpublic static <T> T decodeInto(byte[] input, Class<T> clazz)
T
- generic type used for inference.input
- the input byte array.clazz
- the clazz which should be decoded into.public static <T> T decodeInto(String input, Class<T> clazz)
T
- generic type used for inference.input
- the input byte array.clazz
- the clazz which should be decoded into.public static <T> T decodeInto(byte[] input, com.couchbase.client.core.deps.com.fasterxml.jackson.core.type.TypeReference<T> type)
T
- generic type used for inference.input
- the input byte array.type
- the type which should be decoded into.public static <T> T decodeInto(String input, com.couchbase.client.core.deps.com.fasterxml.jackson.core.type.TypeReference<T> type)
T
- generic type used for inference.input
- the input byte array.type
- the type which should be decoded into.public static com.couchbase.client.core.deps.com.fasterxml.jackson.databind.JsonNode decodeIntoTree(byte[] input)
input
- the input byte array.public static <T> T convertValue(Object fromValue, Class<T> toValueType)
ObjectMapper.convertValue(Object, Class)
.public static <T> T convertValue(Object fromValue, com.couchbase.client.core.deps.com.fasterxml.jackson.core.type.TypeReference<T> toValueTypeRef)
ObjectMapper.convertValue(Object, TypeReference)
.public static com.couchbase.client.core.deps.com.fasterxml.jackson.databind.ObjectReader reader()
public static com.couchbase.client.core.deps.com.fasterxml.jackson.databind.ObjectWriter writer()
public static com.couchbase.client.core.deps.com.fasterxml.jackson.databind.node.ObjectNode createObjectNode()
public static com.couchbase.client.core.deps.com.fasterxml.jackson.databind.node.ArrayNode createArrayNode()
Copyright © 2020 Couchbase, Inc.. All rights reserved.