Clover icon

Coverage Report

  1. Project Clover database Thu Dec 4 2025 16:11:35 GMT
  2. Package jalview.ws2.api

File Credentials.java

 

Coverage histogram

../../../img/srcFileCovDistChart1.png
57% of files have more coverage

Code metrics

6
26
8
1
73
60
11
0.42
3.25
8
1.38

Classes

Class Line # Actions
Credentials 5 26 11
0.0757.5%
 

Contributing tests

This file is covered by 48 tests. .

Source view

1    package jalview.ws2.api;
2   
3    import java.util.Objects;
4   
 
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   
 
15  1 toggle private Credentials()
16    {
17    }
18   
 
19  0 toggle public String getUsername()
20    {
21  0 return username;
22    }
23   
 
24  0 toggle public String getEmail()
25    {
26  0 return email;
27    }
28   
 
29  0 toggle public String getPassword()
30    {
31  0 return password;
32    }
33   
 
34  54 toggle public static final Credentials empty()
35    {
36  54 return EMPTY;
37    }
38   
 
39  0 toggle 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   
 
49  0 toggle 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   
 
61  0 toggle 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    }