@Component public class JsonConverter extends Object
| Constructor and Description |
|---|
JsonConverter() |
| Modifier and Type | Method and Description |
|---|---|
<T> Optional<String> |
toJson(T object) |
<T> Optional<T> |
toJsonField(InputStream stream,
String fieldName,
com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
Converts value from input stream into JSON and extracts its field by given name
|
List<String> |
toJsonGetValuesForField(InputStream stream,
String fieldName) |
<T> Optional<T> |
toObject(byte[] bytes,
com.fasterxml.jackson.core.type.TypeReference valueTypeRef) |
<T> Optional<T> |
toObject(String json,
Class<T> target) |
public <T> Optional<T> toObject(byte[] bytes, com.fasterxml.jackson.core.type.TypeReference valueTypeRef)
public <T> Optional<T> toJsonField(InputStream stream, String fieldName, com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
T - type of the field to be extractedstream - input stream used to read JSON contentfieldName - name of the JSON field to be extractedtypeReference - type reference of the fieldpublic List<String> toJsonGetValuesForField(InputStream stream, String fieldName)
Copyright © 2019. All rights reserved.