Created
August 23, 2017 14:32
-
-
Save aemxn/5e1faf9fc58b02fb4e6eef868f92ae42 to your computer and use it in GitHub Desktop.
LoginResponse model
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 LoginResponse { | |
private static final String KEY_SUCCESS = "success"; | |
private static final String KEY_TOKEN = "token"; | |
@SerializedName(KEY_SUCCESS) | |
private int success; | |
@SerializedName(KEY_TOKEN) | |
private String token; | |
public LoginResponse() { | |
} | |
private LoginResponse(Builder builder) { | |
success = builder.success; | |
token = builder.token; | |
} | |
public static Builder newBuilder() { | |
return new Builder(); | |
} | |
public static final class Builder { | |
private int success; | |
private String token; | |
private Builder() { | |
} | |
public Builder withSuccess(int val) { | |
success = val; | |
return this; | |
} | |
public Builder withToken(String val) { | |
token = val; | |
return this; | |
} | |
public LoginResponse build() { | |
return new LoginResponse(this); | |
} | |
} | |
// getter | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment