Skip to content

Instantly share code, notes, and snippets.

@IlyaEremin
Last active August 29, 2015 14:11
Show Gist options
  • Save IlyaEremin/8b0b120b1530443368f9 to your computer and use it in GitHub Desktop.
Save IlyaEremin/8b0b120b1530443368f9 to your computer and use it in GitHub Desktop.
jackson generic object wrapper ohohohoho!!!
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