1 | |
package org.kuali.student.common.ui.client.util; |
2 | |
|
3 | |
import java.io.Serializable; |
4 | |
import java.util.List; |
5 | |
|
6 | |
public class ExportElement implements Serializable { |
7 | |
|
8 | |
private static final long serialVersionUID = 1L; |
9 | |
private String fieldLabel; |
10 | |
private boolean isMandatory; |
11 | |
|
12 | |
private String fieldValue; |
13 | |
private String fieldValue2; |
14 | |
private String viewName; |
15 | |
|
16 | |
public ExportElement() { |
17 | 34 | super(); |
18 | 34 | } |
19 | |
|
20 | |
public ExportElement(String viewName, String sectionName) { |
21 | 0 | super(); |
22 | 0 | this.viewName = viewName; |
23 | 0 | this.sectionName = sectionName; |
24 | 0 | } |
25 | |
|
26 | |
private String sectionName; |
27 | |
private List<ExportElement> subset; |
28 | |
|
29 | |
public String getViewName() { |
30 | 0 | return viewName; |
31 | |
} |
32 | |
|
33 | |
public void setViewName(String viewName) { |
34 | 0 | this.viewName = viewName; |
35 | 0 | } |
36 | |
|
37 | |
public String getSectionName() { |
38 | 84 | return sectionName; |
39 | |
} |
40 | |
|
41 | |
public void setSectionName(String sectionName) { |
42 | 18 | this.sectionName = sectionName; |
43 | 18 | } |
44 | |
|
45 | |
public String getFieldLabel() { |
46 | 88 | return fieldLabel; |
47 | |
} |
48 | |
|
49 | |
public void setFieldLabel(String fieldLabel) { |
50 | 22 | this.fieldLabel = fieldLabel; |
51 | 22 | } |
52 | |
|
53 | |
public String getFieldValue() { |
54 | 96 | return this.fieldValue; |
55 | |
} |
56 | |
|
57 | |
public void setFieldValue(String fieldValue) { |
58 | 25 | this.fieldValue = fieldValue; |
59 | 25 | if (this.fieldValue != null && this.fieldValue.equals("")) { |
60 | 1 | System.out.println("Stop gou hier"); |
61 | |
} |
62 | 25 | } |
63 | |
|
64 | |
public boolean isSub() { |
65 | 48 | return subset != null; |
66 | |
} |
67 | |
|
68 | |
public List<ExportElement> getSubset() { |
69 | 48 | return subset; |
70 | |
} |
71 | |
|
72 | |
public void setSubset(List<ExportElement> subset) { |
73 | 7 | if (subset != null && subset.size() > 0) { |
74 | 7 | this.subset = subset; |
75 | |
} |
76 | 7 | } |
77 | |
|
78 | |
public boolean isMandatory() { |
79 | 48 | return isMandatory; |
80 | |
} |
81 | |
|
82 | |
public void setMandatory(boolean isMandatory) { |
83 | 4 | this.isMandatory = isMandatory; |
84 | 4 | } |
85 | |
|
86 | |
public String getFieldValue2() { |
87 | 18 | return fieldValue2; |
88 | |
} |
89 | |
|
90 | |
public void setFieldValue2(String fieldValue2) { |
91 | 14 | this.fieldValue2 = fieldValue2; |
92 | 14 | } |
93 | |
|
94 | |
public String getKey() { |
95 | 48 | if (this.getFieldLabel() != null) { |
96 | 40 | return this.getFieldLabel(); |
97 | |
} |
98 | 8 | return ""; |
99 | |
} |
100 | |
|
101 | |
public String getValue() { |
102 | 42 | if (this.getFieldValue() != null) { |
103 | 34 | return getFieldValue(); |
104 | |
} |
105 | 8 | return ""; |
106 | |
} |
107 | |
|
108 | |
public String getProposalValue() { |
109 | 11 | if (this.getFieldValue() != null) { |
110 | 9 | return getFieldValue(); |
111 | |
} |
112 | 2 | return ""; |
113 | |
} |
114 | |
|
115 | |
public String getOriginalValue() { |
116 | 11 | if (this.getFieldValue2() != null) { |
117 | 7 | return this.getFieldValue2(); |
118 | |
} |
119 | 4 | return ""; |
120 | |
} |
121 | |
|
122 | |
public boolean isDataEmpty() { |
123 | 0 | if ((this.fieldLabel == null) && (this.fieldValue == null) && (this.fieldValue2 == null)) { |
124 | 0 | return true; |
125 | |
} |
126 | 0 | return false; |
127 | |
} |
128 | |
|
129 | |
public boolean isEmpty() { |
130 | 111 | if ((this.fieldLabel == null) && (this.fieldValue == null) && (this.fieldValue2 == null) && (this.subset == null)) { |
131 | 5 | return true; |
132 | |
} |
133 | 106 | return false; |
134 | |
} |
135 | |
|
136 | |
public String toString() { |
137 | 0 | return this.sectionName + " - " + this.viewName + " - " + this.getFieldLabel() + " - " + this.getFieldValue() + " - " + this.getFieldValue2(); |
138 | |
} |
139 | |
|
140 | |
} |