| 1 |
|
package jalview.ws2.api; |
| 2 |
|
|
| 3 |
|
import java.util.Objects; |
| 4 |
|
|
| |
|
| 0% |
Uncovered Elements: 40 (40) |
Complexity: 11 |
Complexity Density: 0.42 |
|
| 5 |
|
public final class Credentials |
| 6 |
|
{ |
| 7 |
|
String username = null; |
| 8 |
|
|
| 9 |
|
String email = null; |
| 10 |
|
|
| 11 |
|
String password = null; |
| 12 |
|
|
| 13 |
|
private static final Credentials EMPTY = new Credentials(); |
| 14 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 15 |
0 |
private Credentials()... |
| 16 |
|
{ |
| 17 |
|
} |
| 18 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 19 |
0 |
public String getUsername()... |
| 20 |
|
{ |
| 21 |
0 |
return username; |
| 22 |
|
} |
| 23 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 24 |
0 |
public String getEmail()... |
| 25 |
|
{ |
| 26 |
0 |
return email; |
| 27 |
|
} |
| 28 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 29 |
0 |
public String getPassword()... |
| 30 |
|
{ |
| 31 |
0 |
return password; |
| 32 |
|
} |
| 33 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 34 |
0 |
public static final Credentials empty()... |
| 35 |
|
{ |
| 36 |
0 |
return EMPTY; |
| 37 |
|
} |
| 38 |
|
|
| |
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
| 39 |
0 |
public static final Credentials usingEmail(String email)... |
| 40 |
|
{ |
| 41 |
0 |
Objects.requireNonNull(email); |
| 42 |
0 |
if (email.isEmpty()) |
| 43 |
0 |
throw new IllegalArgumentException("empty email"); |
| 44 |
0 |
Credentials credentials = new Credentials(); |
| 45 |
0 |
credentials.email = email; |
| 46 |
0 |
return credentials; |
| 47 |
|
} |
| 48 |
|
|
| |
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 2 |
Complexity Density: 0.25 |
|
| 49 |
0 |
public static final Credentials usingEmail(String email, String password)... |
| 50 |
|
{ |
| 51 |
0 |
Objects.requireNonNull(email); |
| 52 |
0 |
Objects.requireNonNull(password); |
| 53 |
0 |
if (email.isEmpty()) |
| 54 |
0 |
throw new IllegalArgumentException("empty email"); |
| 55 |
0 |
Credentials credentials = new Credentials(); |
| 56 |
0 |
credentials.email = email; |
| 57 |
0 |
credentials.password = password; |
| 58 |
0 |
return credentials; |
| 59 |
|
} |
| 60 |
|
|
| |
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 2 |
Complexity Density: 0.25 |
|
| 61 |
0 |
public static final Credentials usingUsername(String username,... |
| 62 |
|
String password) |
| 63 |
|
{ |
| 64 |
0 |
Objects.requireNonNull(username); |
| 65 |
0 |
Objects.requireNonNull(password); |
| 66 |
0 |
if (username.isEmpty()) |
| 67 |
0 |
throw new IllegalArgumentException("empty username"); |
| 68 |
0 |
Credentials credentials = new Credentials(); |
| 69 |
0 |
credentials.username = username; |
| 70 |
0 |
credentials.password = password; |
| 71 |
0 |
return credentials; |
| 72 |
|
} |
| 73 |
|
} |