Skip to content

Instantly share code, notes, and snippets.

@aemxn
Created August 23, 2017 14:30
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 aemxn/7377e0ef6f1d6f28c299018f04375061 to your computer and use it in GitHub Desktop.
Save aemxn/7377e0ef6f1d6f28c299018f04375061 to your computer and use it in GitHub Desktop.
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