JAL-3954 Create getters for Credentials record
authorMateusz Warowny <mmzwarowny@dundee.ac.uk>
Mon, 8 May 2023 14:25:29 +0000 (16:25 +0200)
committerMateusz Warowny <mmzwarowny@dundee.ac.uk>
Mon, 8 May 2023 14:25:29 +0000 (16:25 +0200)
src/jalview/ws2/api/Credentials.java

index cc7c714..5e482ab 100644 (file)
@@ -5,19 +5,39 @@ import java.util.Objects;
 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");
@@ -25,8 +45,9 @@ public final class Credentials
     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())
@@ -36,8 +57,10 @@ public final class Credentials
     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())