Last active
August 29, 2015 14:11
-
-
Save IlyaEremin/8b0b120b1530443368f9 to your computer and use it in GitHub Desktop.
jackson generic object wrapper ohohohoho!!!
This file contains 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
public class Wrapper<T> { | |
@JsonCreator | |
public Wrapper(){} | |
protected Map<String, T> map = new HashMap<>(); | |
@JsonAnySetter public void set(String name, T t) { | |
map.put(name, t); | |
} | |
public T getData(){ | |
return map.values().iterator().next(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment