Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Login model
public class Login {
private static final String KEY_USERNAME = "username";
private static final String KEY_PASSWORD = "password";
private static final String KEY_DEVICEID = "deviceid";
private static final String KEY_DEVICENAME = "devicename";
private static final String KEY_NOTIFICATIONTOKEN = "notificationtoken";
@SerializedName(KEY_USERNAME)
private String username;
@SerializedName(KEY_PASSWORD)
private String password;
@SerializedName(KEY_DEVICEID)
private String deviceid;
@SerializedName(KEY_DEVICENAME)
private String devicename;
@SerializedName(KEY_NOTIFICATIONTOKEN)
private String notificationtoken;
public Login() {
}
private Login(Builder builder) {
username = builder.username;
password = builder.password;
deviceid = builder.deviceid;
devicename = builder.devicename;
notificationtoken = builder.notificationtoken;
}
public static Builder newBuilder() {
return new Builder();
}
public static final class Builder {
private String username;
private String password;
private String deviceid;
private String devicename;
private String notificationtoken;
private Builder() {
}
public Builder withUsername(String val) {
username = val;
return this;
}
public Builder withPassword(String val) {
password = val;
return this;
}
public Builder withDeviceid(String val) {
deviceid = val;
return this;
}
public Builder withDevicename(String val) {
devicename = val;
return this;
}
public Builder withNotificationtoken(String val) {
notificationtoken = val;
return this;
}
public Login build() {
return new Login(this);
}
}
// getter
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment