You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
892 B
41 lines
892 B
4 years ago
|
package com.community.pocket.ui.login;
|
||
|
|
||
|
import androidx.annotation.Nullable;
|
||
|
|
||
|
/**
|
||
|
* Data validation state of the login form.
|
||
|
*/
|
||
|
class LoginFormState {
|
||
|
@Nullable
|
||
|
private Integer usernameError;
|
||
|
@Nullable
|
||
|
private Integer passwordError;
|
||
|
private boolean isDataValid;
|
||
|
|
||
|
LoginFormState(@Nullable Integer usernameError, @Nullable Integer passwordError) {
|
||
|
this.usernameError = usernameError;
|
||
|
this.passwordError = passwordError;
|
||
|
this.isDataValid = false;
|
||
|
}
|
||
|
|
||
|
LoginFormState(boolean isDataValid) {
|
||
|
this.usernameError = null;
|
||
|
this.passwordError = null;
|
||
|
this.isDataValid = isDataValid;
|
||
|
}
|
||
|
|
||
|
@Nullable
|
||
|
Integer getUsernameError() {
|
||
|
return usernameError;
|
||
|
}
|
||
|
|
||
|
@Nullable
|
||
|
Integer getPasswordError() {
|
||
|
return passwordError;
|
||
|
}
|
||
|
|
||
|
boolean isDataValid() {
|
||
|
return isDataValid;
|
||
|
}
|
||
|
}
|