SHARE
TWEET

Untitled

a guest Feb 18th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import android.support.annotation.NonNull;
  2. import android.text.TextUtils;
  3. import android.util.Patterns;
  4.  
  5. public class User {
  6.     @NonNull
  7.     private String mEmail;
  8.     @NonNull
  9.     private String mPassword;
  10.  
  11.     public User(@NonNull final String email, @NonNull final String password) {
  12.         mEmail = email;
  13.         mPassword = password;
  14.     }
  15.  
  16.     @NonNull
  17.     public String getEmail() {
  18.         return mEmail;
  19.     }
  20.  
  21.     public void setEmail(@NonNull final String email) {
  22.         mEmail = email;
  23.     }
  24.  
  25.     @NonNull
  26.     public String getPassword() {
  27.         return mPassword;
  28.     }
  29.  
  30.     public void setPassword(@NonNull final String password) {
  31.         mPassword = password;
  32.     }
  33.  
  34.     public boolean isInputDataValid() {
  35.         return !TextUtils.isEmpty(getEmail()) && Patterns.EMAIL_ADDRESS.matcher(getEmail()).matches() && getPassword().length() > 5;
  36.     }
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top