-
-
Save softprops/641214 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
| import java.io.Serializable; | |
| import org.codehaus.jackson.annotate.JsonProperty; | |
| public class Foo implements Serializable { | |
| private static final long serialVersionUID = 1L; | |
| @JsonProperty("id") | |
| private Long id; | |
| @JsonProperty("n") | |
| private String name; | |
| public Long getId() { | |
| return id; | |
| } | |
| public void setId(Long id) { | |
| this.id = id; | |
| } | |
| public String getName() { | |
| return name; | |
| } | |
| public void setName(String name) { | |
| this.name = name; | |
| } | |
| } |
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
| public List<Foo> list(Long id) throws Exception { | |
| HttpResponse response = client.execute(post(url, params("foo_id", id))); | |
| return mapper.readValue( | |
| response.getEntity().getContent(), | |
| TypeFactory.collectionType(List.class, Foo.class) | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment