Created
July 15, 2018 09:21
-
-
Save jnizet/d1d539da7d6be035edba4124d594aef7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.bar.grrr; | |
import java.io.IOException; | |
import com.fasterxml.jackson.annotation.JsonProperty; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
public class ABC { | |
@JsonProperty("class") | |
private String clazz; | |
public static void main(String[] args) throws IOException { | |
String json = "{\n" + | |
" \"class\": \"foo\"\n" + | |
"}"; | |
ObjectMapper objectMapper = new ObjectMapper(); | |
ABC abc = objectMapper.readValue(json, ABC.class); | |
System.out.println("abc.clazz = " + abc.clazz); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment