Clover icon

Coverage Report

  1. Project Clover database Sun Jan 11 2026 02:28:45 GMT
  2. Package jalview.ws2.api

File WebService.java

 

Coverage histogram

../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

0
44
22
2
182
141
22
0.5
2
11
1

Classes

Class Line # Actions
WebService 12 27 13
0.9595%
WebService.Builder 14 17 9
1.0100%
 

Contributing tests

This file is covered by 425 tests. .

Source view

1    package jalview.ws2.api;
2   
3    import java.net.URL;
4    import java.util.ArrayList;
5    import java.util.Collection;
6    import java.util.List;
7    import jalview.ws.params.ParamDatastoreI;
8    import jalview.ws2.actions.api.ActionI;
9   
10    import static java.util.Objects.requireNonNull;
11   
 
12    public class WebService<A extends ActionI<?>>
13    {
 
14    public static class Builder<A extends ActionI<?>>
15    {
16    private URL url;
17   
18    private String clientName;
19   
20    private String category;
21   
22    private String name;
23   
24    private String description = "";
25   
26    private boolean interactive = false;
27   
28    private ParamDatastoreI paramDatastore;
29   
30    private Class<A> actionClass;
31   
 
32  1526 toggle public Builder<A> url(URL val)
33    {
34  1526 url = val;
35  1526 return this;
36    }
37   
 
38  1526 toggle public Builder<A> clientName(String val)
39    {
40  1526 clientName = val;
41  1526 return this;
42    }
43   
 
44  1526 toggle public Builder<A> category(String val)
45    {
46  1526 category = val;
47  1526 return this;
48    }
49   
 
50  1526 toggle public Builder<A> name(String val)
51    {
52  1526 name = val;
53  1526 return this;
54    }
55   
 
56  1500 toggle public Builder<A> description(String val)
57    {
58  1500 description = val;
59  1500 return this;
60    }
61   
 
62  1500 toggle public Builder<A> interactive(boolean val)
63    {
64  1500 interactive = val;
65  1500 return this;
66    }
67   
 
68  1526 toggle public Builder<A> paramDatastore(ParamDatastoreI val)
69    {
70  1526 paramDatastore = val;
71  1526 return this;
72    }
73   
 
74  1526 toggle public Builder<A> actionClass(Class<A> val)
75    {
76  1526 actionClass = val;
77  1526 return this;
78    }
79   
 
80  1526 toggle public WebService<A> build()
81    {
82  1526 return new WebService<A>(this);
83    }
84    }
85   
86    private final URL url;
87   
88    private final String clientName;
89   
90    private final String category;
91   
92    private final String name;
93   
94    private final String description;
95   
96    private final boolean interactive;
97   
98    private final ParamDatastoreI paramDatastore;
99   
100    private final List<A> actions;
101   
102    private final Class<A> actionClass;
103   
 
104  1526 toggle protected WebService(Builder<A> builder)
105    {
106  1526 requireNonNull(builder.url);
107  1526 requireNonNull(builder.clientName);
108  1526 requireNonNull(builder.category);
109  1526 requireNonNull(builder.name);
110  1526 requireNonNull(builder.paramDatastore);
111  1526 requireNonNull(builder.actionClass);
112  1526 this.url = builder.url;
113  1526 this.clientName = builder.clientName;
114  1526 this.category = builder.category;
115  1526 this.name = builder.name;
116  1526 this.description = builder.description;
117  1526 this.interactive = builder.interactive;
118  1526 this.paramDatastore = builder.paramDatastore;
119  1526 this.actions = new ArrayList<>();
120  1526 this.actionClass = builder.actionClass;
121    }
122   
 
123  1526 toggle public static <A extends ActionI<?>> Builder<A> newBuilder()
124    {
125  1526 return new Builder<A>();
126    }
127   
 
128  1763 toggle public void addAction(A action)
129    {
130  1763 this.actions.add(action);
131    }
132   
 
133  0 toggle public void addActions(Collection<? extends A> actions)
134    {
135  0 this.actions.addAll(actions);
136    }
137   
 
138  212476 toggle public URL getUrl()
139    {
140  212477 return url;
141    }
142   
 
143  1 toggle public String getClientName()
144    {
145  1 return clientName;
146    }
147   
 
148  67629 toggle public String getCategory()
149    {
150  67629 return category;
151    }
152   
 
153  236804 toggle public String getName()
154    {
155  236804 return name;
156    }
157   
 
158  1 toggle public String getDescription()
159    {
160  1 return description;
161    }
162   
 
163  67599 toggle public boolean isInteractive()
164    {
165  67599 return interactive;
166    }
167   
 
168  76707 toggle public ParamDatastoreI getParamDatastore()
169    {
170  76707 return paramDatastore;
171    }
172   
 
173  67600 toggle public List<A> getActions()
174    {
175  67600 return actions;
176    }
177   
 
178  33 toggle public Class<A> getActionClass()
179    {
180  33 return actionClass;
181    }
182    }