Clover icon

Coverage Report

  1. Project Clover database Thu Dec 4 2025 16:11:35 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 467 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  1677 toggle public Builder<A> url(URL val)
33    {
34  1677 url = val;
35  1677 return this;
36    }
37   
 
38  1677 toggle public Builder<A> clientName(String val)
39    {
40  1677 clientName = val;
41  1677 return this;
42    }
43   
 
44  1677 toggle public Builder<A> category(String val)
45    {
46  1677 category = val;
47  1677 return this;
48    }
49   
 
50  1677 toggle public Builder<A> name(String val)
51    {
52  1677 name = val;
53  1677 return this;
54    }
55   
 
56  1651 toggle public Builder<A> description(String val)
57    {
58  1651 description = val;
59  1651 return this;
60    }
61   
 
62  1651 toggle public Builder<A> interactive(boolean val)
63    {
64  1651 interactive = val;
65  1651 return this;
66    }
67   
 
68  1677 toggle public Builder<A> paramDatastore(ParamDatastoreI val)
69    {
70  1677 paramDatastore = val;
71  1677 return this;
72    }
73   
 
74  1677 toggle public Builder<A> actionClass(Class<A> val)
75    {
76  1677 actionClass = val;
77  1677 return this;
78    }
79   
 
80  1677 toggle public WebService<A> build()
81    {
82  1677 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  1677 toggle protected WebService(Builder<A> builder)
105    {
106  1677 requireNonNull(builder.url);
107  1677 requireNonNull(builder.clientName);
108  1677 requireNonNull(builder.category);
109  1677 requireNonNull(builder.name);
110  1677 requireNonNull(builder.paramDatastore);
111  1677 requireNonNull(builder.actionClass);
112  1677 this.url = builder.url;
113  1677 this.clientName = builder.clientName;
114  1677 this.category = builder.category;
115  1677 this.name = builder.name;
116  1677 this.description = builder.description;
117  1677 this.interactive = builder.interactive;
118  1677 this.paramDatastore = builder.paramDatastore;
119  1677 this.actions = new ArrayList<>();
120  1677 this.actionClass = builder.actionClass;
121    }
122   
 
123  1677 toggle public static <A extends ActionI<?>> Builder<A> newBuilder()
124    {
125  1677 return new Builder<A>();
126    }
127   
 
128  1941 toggle public void addAction(A action)
129    {
130  1941 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  227465 toggle public URL getUrl()
139    {
140  227465 return url;
141    }
142   
 
143  1 toggle public String getClientName()
144    {
145  1 return clientName;
146    }
147   
 
148  71823 toggle public String getCategory()
149    {
150  71823 return category;
151    }
152   
 
153  253192 toggle public String getName()
154    {
155  253193 return name;
156    }
157   
 
158  1 toggle public String getDescription()
159    {
160  1 return description;
161    }
162   
 
163  71793 toggle public boolean isInteractive()
164    {
165  71793 return interactive;
166    }
167   
 
168  81143 toggle public ParamDatastoreI getParamDatastore()
169    {
170  81143 return paramDatastore;
171    }
172   
 
173  71793 toggle public List<A> getActions()
174    {
175  71793 return actions;
176    }
177   
 
178  33 toggle public Class<A> getActionClass()
179    {
180  33 return actionClass;
181    }
182    }