Administrator
2021-11-03 de74e5ec3fbdab065e8b91240fa1944c4b3440c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.duqing.missions.ui.login.view;
 
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;
    }
}