Created
October 3, 2017 22:05
-
-
Save PierceZ/94f327c3f02b19a6f030af4f4cb99089 to your computer and use it in GitHub Desktop.
This file contains 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 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