Created
January 7, 2014 18:45
-
-
Save vdurmont/8304408 to your computer and use it in GitHub Desktop.
First use of APIPixie
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
// Create an APIPixie instance | |
APIPixie pixie = new APIPixie("http://api.mydistantservice.com"); | |
// Retrieve an APIService for your object | |
APIService<Message> msgService = pixie.getService(Message.class); | |
// Start communicating with the distant API | |
Message msg = msgService.get(42L); | |
// Now do stuff with the object! | |
String text = msg.getText(); |
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
@APIEntity | |
public class Message { | |
private Long id; | |
private String text; | |
// Getters and setters | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment