Example usage for com.fasterxml.jackson.core.type TypeReference toString

List of usage examples for com.fasterxml.jackson.core.type TypeReference toString

Introduction

In this page you can find the example usage for com.fasterxml.jackson.core.type TypeReference toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:org.fasterxml.jackson.tc.TreeTest.java

static <T extends Enum<T>, K> K transcodeFromMap(Map<T, Object> configuration,
        TypeReference<K> configurationType) {
    ObjectMapper mapper = TestEnumModule.setupObjectMapper(new ObjectMapper(new YAMLFactory()));
    JsonNode tree = mapper.valueToTree(configuration);
    try {//from   w ww .j a v  a  2 s . c  o m
        return mapper.readerFor(configurationType).readValue(tree);
    } catch (IOException e) {
        throw new RuntimeException(
                "Failed to map configuration map to object of type " + configurationType.toString(), e);
    }
}