001: /*
002: * Copyright 2005-2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.opensource.org/licenses/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.kuali.module.gl.bo;
017:
018: import java.sql.Date;
019: import java.util.LinkedHashMap;
020:
021: import org.kuali.core.bo.PersistableBusinessObjectBase;
022:
023: public class OriginEntryGroup extends PersistableBusinessObjectBase {
024:
025: private static final String VALID_STRING = "Valid-";
026: private static final String INVALID_STRING = "Error-";
027: private static final String PROCESSED_STRING = "Process-";
028: private static final String NOT_PROCESSED_STRING = "Don't Process-";
029: private static final String SCRUB_STRING = "Scrub";
030: private static final String NO_SCRUB_STRING = "Don't Scrub";
031:
032: private Integer id;
033: private Date date;
034: private String sourceCode;
035: private Boolean valid;
036: private Boolean process;
037: private Boolean scrub;
038:
039: // This does not normally get populated. It only gets populated if
040: // getAllOriginEntryGroup() is called
041: private Integer rows = new Integer(0);
042:
043: private OriginEntrySource source;
044:
045: /**
046: *
047: */
048: public OriginEntryGroup() {
049: super ();
050: }
051:
052: protected LinkedHashMap toStringMapper() {
053: LinkedHashMap map = new LinkedHashMap();
054: map.put("id", id);
055: return map;
056: }
057:
058: public String getName() {
059: StringBuffer sb = new StringBuffer(this .getSourceCode());
060: sb.append(" ");
061: sb.append(source.getName());
062: sb.append(" (");
063: sb.append(rows);
064: sb.append(") ");
065: sb.append(this .getId());
066: sb.append(" ");
067: sb.append(this .getDate().toString());
068: sb.append(" ");
069: sb.append(valid ? VALID_STRING : INVALID_STRING);
070: sb.append(process ? PROCESSED_STRING : NOT_PROCESSED_STRING);
071: sb.append(scrub ? SCRUB_STRING : NO_SCRUB_STRING);
072: return sb.toString();
073: }
074:
075: public Integer getRows() {
076: return rows;
077: }
078:
079: public void setRows(Integer rows) {
080: this .rows = rows;
081: }
082:
083: public OriginEntrySource getSource() {
084: return source;
085: }
086:
087: public void setSource(OriginEntrySource oes) {
088: source = oes;
089: }
090:
091: public Date getDate() {
092: return date;
093: }
094:
095: public void setDate(Date date) {
096: this .date = date;
097: }
098:
099: public Integer getId() {
100: return id;
101: }
102:
103: public void setId(Integer id) {
104: this .id = id;
105: }
106:
107: public Boolean getProcess() {
108: return process;
109: }
110:
111: public void setProcess(Boolean process) {
112: this .process = process;
113: }
114:
115: public Boolean getScrub() {
116: return scrub;
117: }
118:
119: public void setScrub(Boolean scrub) {
120: this .scrub = scrub;
121: }
122:
123: public String getSourceCode() {
124: return sourceCode;
125: }
126:
127: public void setSourceCode(String sourceCode) {
128: this .sourceCode = sourceCode;
129: }
130:
131: public Boolean getValid() {
132: return valid;
133: }
134:
135: public void setValid(Boolean valid) {
136: this.valid = valid;
137: }
138: }
|