public final class Credentials
{
String username = null;
+
String email = null;
+
String password = null;
+
private static final Credentials EMPTY = new Credentials();
- private Credentials() {
+ private Credentials()
+ {
+ }
+
+ public String getUsername()
+ {
+ return username;
+ }
+
+ public String getEmail()
+ {
+ return email;
}
-
+
+ public String getPassword()
+ {
+ return password;
+ }
+
public static final Credentials empty()
{
return EMPTY;
}
- public static final Credentials usingEmail(String email) {
+ public static final Credentials usingEmail(String email)
+ {
Objects.requireNonNull(email);
if (email.isEmpty())
throw new IllegalArgumentException("empty email");
credentials.email = email;
return credentials;
}
-
- public static final Credentials usingEmail(String email, String password) {
+
+ public static final Credentials usingEmail(String email, String password)
+ {
Objects.requireNonNull(email);
Objects.requireNonNull(password);
if (email.isEmpty())
credentials.password = password;
return credentials;
}
-
- public static final Credentials usingUsername(String username, String password) {
+
+ public static final Credentials usingUsername(String username,
+ String password)
+ {
Objects.requireNonNull(username);
Objects.requireNonNull(password);
if (username.isEmpty())