Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
LoginResponse model
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