1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.gl.businessobject;
17
18 import java.sql.Date;
19 import java.util.Comparator;
20 import java.util.LinkedHashMap;
21
22 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
23
24 public class OriginEntryGroup extends PersistableBusinessObjectBase {
25
26 private static final String VALID_STRING = "Valid-";
27 private static final String INVALID_STRING = "Error-";
28 private static final String PROCESSED_STRING = "Process-";
29 private static final String NOT_PROCESSED_STRING = "Don't Process-";
30 private static final String SCRUB_STRING = "Scrub";
31 private static final String NO_SCRUB_STRING = "Don't Scrub";
32
33 private Integer id;
34 private Date date;
35 private String sourceCode;
36 private Boolean valid;
37 private Boolean process;
38 private Boolean scrub;
39
40
41
42 private Integer rows = new Integer(0);
43
44 private OriginEntrySource source;
45
46
47
48
49 public OriginEntryGroup() {
50 super();
51 }
52
53 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
54 LinkedHashMap map = new LinkedHashMap();
55 map.put("id", id);
56 return map;
57 }
58
59 public String getName() {
60 StringBuffer sb = new StringBuffer(this.getSourceCode());
61 sb.append(" ");
62 sb.append(source.getName());
63 sb.append(" (");
64 sb.append(rows);
65 sb.append(") ");
66 sb.append(this.getId());
67 sb.append(" ");
68 sb.append(this.getDate().toString());
69 sb.append(" ");
70 sb.append(valid ? VALID_STRING : INVALID_STRING);
71 sb.append(process ? PROCESSED_STRING : NOT_PROCESSED_STRING);
72 sb.append(scrub ? SCRUB_STRING : NO_SCRUB_STRING);
73 return sb.toString();
74 }
75
76 public Integer getRows() {
77 return rows;
78 }
79
80 public void setRows(Integer rows) {
81 this.rows = rows;
82 }
83
84 public OriginEntrySource getSource() {
85 return source;
86 }
87
88 public void setSource(OriginEntrySource oes) {
89 source = oes;
90 }
91
92 public Date getDate() {
93 return date;
94 }
95
96 public void setDate(Date date) {
97 this.date = date;
98 }
99
100 public Integer getId() {
101 return id;
102 }
103
104 public void setId(Integer id) {
105 this.id = id;
106 }
107
108 public Boolean getProcess() {
109 return process;
110 }
111
112 public void setProcess(Boolean process) {
113 this.process = process;
114 }
115
116 public Boolean getScrub() {
117 return scrub;
118 }
119
120 public void setScrub(Boolean scrub) {
121 this.scrub = scrub;
122 }
123
124 public String getSourceCode() {
125 return sourceCode;
126 }
127
128 public void setSourceCode(String sourceCode) {
129 this.sourceCode = sourceCode;
130 }
131
132 public Boolean getValid() {
133 return valid;
134 }
135
136 public void setValid(Boolean valid) {
137 this.valid = valid;
138 }
139
140
141
142
143 public static class GroupTypeComparator implements Comparator {
144
145
146
147 public GroupTypeComparator() {
148 }
149
150
151
152
153
154
155
156
157
158 public int compare(Object c1, Object c2) {
159
160 OriginEntryGroup oeg1 = (OriginEntryGroup) c1;
161 OriginEntryGroup oeg2 = (OriginEntryGroup) c2;
162
163 String sort1 = oeg1.getSourceCode();
164 String sort2 = oeg2.getSourceCode();
165
166 int c = sort1.compareTo(sort2);
167 if (c != 0) {
168 return c;
169 }
170 return oeg1.getId().compareTo(oeg2.getId());
171 }
172 }
173
174 }