Skip to content

Instantly share code, notes, and snippets.

@vdurmont
Created January 7, 2014 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vdurmont/8304408 to your computer and use it in GitHub Desktop.
Save vdurmont/8304408 to your computer and use it in GitHub Desktop.
First use of APIPixie
// 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();
@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