1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.contract.model.test.source;
17
18 import java.io.Serializable;
19 import java.util.ArrayList;
20 import java.util.Arrays;
21 import java.util.List;
22
23 import javax.xml.bind.annotation.XmlAccessType;
24 import javax.xml.bind.annotation.XmlAccessorType;
25 import javax.xml.bind.annotation.XmlAnyElement;
26 import javax.xml.bind.annotation.XmlAttribute;
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.contract.model.test.source.ModelBuilder;
32 import org.kuali.student.contract.model.test.source.SearchParam;
33 import org.w3c.dom.Element;
34
35
36
37
38
39
40
41
42 @XmlAccessorType(XmlAccessType.FIELD)
43 @XmlType(name = "SearchParamInfo", propOrder = {"key", "values", "_futureElements"})
44 public class SearchParamInfo implements SearchParam, Serializable {
45
46 private static final long serialVersionUID = 1L;
47 @XmlAttribute
48 private final String key;
49 @XmlElementWrapper(name="values")
50 @XmlElement(name="value")
51 private final List<String> values;
52 @XmlAnyElement
53 private final List<Element> _futureElements;
54
55
56 public SearchParamInfo() {
57 this.key = null;
58 this.values = null;
59 this._futureElements = null;
60 }
61
62 public SearchParamInfo(SearchParam infc) {
63 this.key = infc.getKey();
64 if (this.values == null) {
65 this.values = null;
66 } else {
67 this.values = new ArrayList(infc.getValues());
68 }
69 this._futureElements = null;
70 }
71
72 @Override
73 public List<String> getValues() {
74 return values;
75 }
76
77 @Override
78 public String getKey() {
79 return key;
80 }
81
82 public static class Builder implements ModelBuilder<SearchParamInfo>, SearchParam {
83
84 private String key;
85 private List<String> values;
86
87 public Builder() {}
88
89 public Builder(SearchParam searchInfo) {
90 this.key = searchInfo.getKey();
91 this.values = searchInfo.getValues();
92 }
93
94 public SearchParamInfo build () {
95 return new SearchParamInfo (this);
96 }
97
98 public String getKey() {
99 return key;
100 }
101
102 public void setKey(String key) {
103 this.key = key;
104 }
105
106 public List<String> getValues() {
107 return values;
108 }
109
110 public void setValues(List<String> values) {
111 this.values = values;
112 }
113
114
115
116
117
118
119 public Builder value(String value) {
120 this.values = Arrays.asList(value);
121 return this;
122 }
123 }
124 }