1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.kuali.student.r2.common.dto; |
17 |
|
|
18 |
|
import java.io.Serializable; |
19 |
|
import java.util.ArrayList; |
20 |
|
import java.util.Arrays; |
21 |
|
import java.util.Collections; |
22 |
|
import java.util.List; |
23 |
|
|
24 |
|
import javax.xml.bind.annotation.XmlAccessType; |
25 |
|
import javax.xml.bind.annotation.XmlAccessorType; |
26 |
|
import javax.xml.bind.annotation.XmlAnyElement; |
27 |
|
import javax.xml.bind.annotation.XmlElement; |
28 |
|
import javax.xml.bind.annotation.XmlElementWrapper; |
29 |
|
import javax.xml.bind.annotation.XmlType; |
30 |
|
|
31 |
|
import org.kuali.student.r2.common.infc.Comparison; |
32 |
|
import org.kuali.student.r2.common.infc.ModelBuilder; |
33 |
|
import org.w3c.dom.Element; |
34 |
|
|
35 |
|
@XmlAccessorType(XmlAccessType.FIELD) |
36 |
|
@XmlType(name = "ComparisonInfo", propOrder = {"fieldKey", "operator", "values", "ignoreCase", "_futureElements"}) |
|
|
| 0% |
Uncovered Elements: 24 (24) |
Complexity: 7 |
Complexity Density: 0.44 |
|
37 |
|
public class ComparisonInfo implements Comparison, Serializable { |
38 |
|
|
39 |
|
private static final long serialVersionUID = 1L; |
40 |
|
@XmlElement |
41 |
|
private final String fieldKey; |
42 |
|
|
43 |
|
@XmlElement |
44 |
|
private final String operator; |
45 |
|
|
46 |
|
@XmlElementWrapper(name="values") |
47 |
|
@XmlElement(name="value") |
48 |
|
private final List<String> values; |
49 |
|
|
50 |
|
@XmlElement |
51 |
|
private final boolean ignoreCase; |
52 |
|
|
53 |
|
@XmlAnyElement |
54 |
|
private final List<Element> _futureElements; |
55 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
56 |
0
|
private ComparisonInfo() {... |
57 |
0
|
this.fieldKey = null; |
58 |
0
|
this.operator = null; |
59 |
0
|
this.values = null; |
60 |
0
|
this.ignoreCase = false; |
61 |
0
|
this._futureElements = null; |
62 |
|
} |
63 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
64 |
0
|
private ComparisonInfo(Comparison bldr) {... |
65 |
0
|
this.fieldKey = bldr.getFieldKey(); |
66 |
0
|
this.operator = bldr.getOperator(); |
67 |
0
|
if (bldr.getValues() == null) |
68 |
|
{ |
69 |
0
|
this.values = null; |
70 |
|
}else |
71 |
|
{ |
72 |
0
|
this.values = Collections.unmodifiableList(bldr.getValues()); |
73 |
|
} |
74 |
0
|
this.ignoreCase = bldr.isIgnoreCase(); |
75 |
0
|
this._futureElements = null; |
76 |
|
} |
77 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
78 |
0
|
@Override... |
79 |
|
public String getFieldKey() { |
80 |
0
|
return fieldKey; |
81 |
|
} |
82 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
83 |
0
|
@Override... |
84 |
|
public String getOperator() { |
85 |
0
|
return operator; |
86 |
|
} |
87 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
88 |
0
|
@Override... |
89 |
|
public List<String> getValues() { |
90 |
0
|
return values; |
91 |
|
} |
92 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
93 |
0
|
@Override... |
94 |
|
public boolean isIgnoreCase() { |
95 |
0
|
return this.ignoreCase; |
96 |
|
} |
97 |
|
|
|
|
| 0% |
Uncovered Elements: 30 (30) |
Complexity: 13 |
Complexity Density: 0.81 |
|
98 |
|
public static class Builder implements ModelBuilder<ComparisonInfo>, Comparison { |
99 |
|
|
100 |
|
private String fieldKey; |
101 |
|
private String operator; |
102 |
|
private List<String> values; |
103 |
|
private boolean ignoreCase; |
104 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
105 |
0
|
public Builder() {... |
106 |
|
} |
107 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
108 |
0
|
public Builder(Comparison infc) {... |
109 |
0
|
this.fieldKey = infc.getFieldKey(); |
110 |
0
|
this.operator = infc.getOperator(); |
111 |
0
|
if (infc.getValues() != null) { |
112 |
0
|
this.values = new ArrayList<String>(infc.getValues()); |
113 |
|
} |
114 |
|
} |
115 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
116 |
0
|
public ComparisonInfo build() {... |
117 |
0
|
return new ComparisonInfo(this); |
118 |
|
} |
119 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
120 |
0
|
@Override... |
121 |
|
public String getFieldKey() { |
122 |
0
|
return fieldKey; |
123 |
|
} |
124 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
125 |
0
|
@Override... |
126 |
|
public String getOperator() { |
127 |
0
|
return operator; |
128 |
|
} |
129 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
130 |
0
|
@Override... |
131 |
|
public List<String> getValues() { |
132 |
0
|
return values; |
133 |
|
} |
134 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
135 |
0
|
@Override... |
136 |
|
public boolean isIgnoreCase() { |
137 |
0
|
return this.ignoreCase; |
138 |
|
} |
139 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
140 |
0
|
public Builder setFieldKey(String fieldKey) {... |
141 |
0
|
this.fieldKey = fieldKey; |
142 |
0
|
return this; |
143 |
|
} |
144 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
145 |
0
|
public Builder setOperator(String operator) {... |
146 |
0
|
this.operator = operator; |
147 |
0
|
return this; |
148 |
|
} |
149 |
|
|
150 |
|
|
151 |
|
|
152 |
|
@param |
153 |
|
@return |
154 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
155 |
0
|
public void setValue(String value) {... |
156 |
0
|
this.setValues(Arrays.asList(value)); |
157 |
|
} |
158 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
159 |
0
|
public void setValues(List<String> values) {... |
160 |
0
|
this.values = values; |
161 |
|
} |
162 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
163 |
0
|
public void setIgnoreCase(boolean ignoreCase) {... |
164 |
0
|
this.ignoreCase = ignoreCase; |
165 |
|
} |
166 |
|
} |
167 |
|
} |