Clover icon

Coverage Report

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