Skip to content

Instantly share code, notes, and snippets.

@PierceZ
Created October 3, 2017 22:05
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 PierceZ/94f327c3f02b19a6f030af4f4cb99089 to your computer and use it in GitHub Desktop.
Save PierceZ/94f327c3f02b19a6f030af4f4cb99089 to your computer and use it in GitHub Desktop.
public class Response {
public static final int STATUS_LOADING = 0, STATUS_SUCCESS = 1, STATUS_FAIL = 2;
@Retention(SOURCE)
@IntDef({STATUS_LOADING, STATUS_SUCCESS, STATUS_FAIL})
@interface Status {
}
private final int mStatus;
private String mPayload;
public Response(@Status int status, String payload) {
mStatus = status;
mPayload = payload;
}
@Status
public int getStatus() {
return mStatus;
}
public String getPayload() {
return mPayload;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment