Clover icon

Coverage Report

  1. Project Clover database Thu Dec 4 2025 14:43:25 GMT
  2. Package jalview.ws.params.simple

File StringParameter.java

 

Coverage histogram

../../../../img/srcFileCovDistChart2.png
54% of files have more coverage

Code metrics

0
17
12
3
107
79
12
0.71
1.42
4
1

Classes

Class Line # Actions
StringParameter 8 13 8
0.190476219%
StringParameter.Builder 10 1 1
1.0100%
StringParameter.StringValueConstrain 31 3 3
0.00%
 

Contributing tests

This file is covered by 58 tests. .

Source view

1    package jalview.ws.params.simple;
2   
3    import jalview.ws.params.ParameterI;
4    import jalview.ws.params.ValueConstrainI;
5   
6    import java.util.List;
7   
 
8    public class StringParameter extends Option implements ParameterI
9    {
 
10    public static class Builder extends Option.Builder
11    {
 
12  3048 toggle @Override
13    public StringParameter build()
14    {
15  3048 return new StringParameter(this);
16    }
17    }
18   
 
19  0 toggle @Override
20    public ValueConstrainI getValidValue()
21    {
22  0 return new StringValueConstrain();
23    }
24   
 
25  0 toggle @Override
26    public ParameterI copy()
27    {
28  0 return new StringParameter(this);
29    }
30   
 
31    private class StringValueConstrain implements ValueConstrainI
32    {
33   
 
34  0 toggle @Override
35    public ValueType getType()
36    {
37  0 return ValueType.String;
38    }
39   
 
40  0 toggle @Override
41    public Number getMax()
42    {
43  0 return null;
44    }
45   
 
46  0 toggle @Override
47    public Number getMin()
48    {
49  0 return null;
50    }
51   
52    }
53   
 
54  3048 toggle public static Builder newBuilder()
55    {
56  3048 return new Builder();
57    }
58   
 
59  3048 toggle protected StringParameter(Builder builder)
60    {
61  3048 super(builder);
62    }
63   
 
64  0 toggle public StringParameter(StringParameter parm)
65    {
66  0 this.name = parm.name;
67  0 this.defvalue = parm.defvalue;
68  0 this.possibleVals = parm.possibleVals;
69  0 this.displayVals = parm.displayVals;
70    }
71   
 
72  0 toggle public StringParameter(String name, String description, boolean required,
73    String defValue)
74    {
75  0 super(name, description, required, String.valueOf(defValue), null, null,
76    null);
77  0 this.defvalue = defValue;
78    }
79   
 
80  0 toggle public StringParameter(String name, String description, boolean required,
81    String defValue, String value)
82    {
83  0 super(name, description, required, String.valueOf(defValue),
84    String.valueOf(value), null, null);
85  0 this.defvalue = defValue;
86    }
87   
88    /**
89    * Constructor for a parameter with a list of possible values and (optionally)
90    * corresponding display names
91    *
92    * @param name2
93    * @param description2
94    * @param isrequired
95    * @param defValue
96    * @param value
97    * @param possibleVals
98    * @param displayNames
99    */
 
100  0 toggle public StringParameter(String name2, String description2,
101    boolean isrequired, String defValue, String value,
102    List<String> possibleVals, List<String> displayNames)
103    {
104  0 super(name2, description2, isrequired, defValue, value, possibleVals,
105    displayNames, null);
106    }
107    }