001: /*
002: * Copyright 2006-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:
017: package org.kuali.module.kra.routingform.bo;
018:
019: import java.util.LinkedHashMap;
020:
021: import org.kuali.core.bo.PersistableBusinessObjectBase;
022: import org.kuali.core.util.ObjectUtils;
023: import org.kuali.kfs.KFSPropertyConstants;
024:
025: /**
026: *
027: */
028: public class RoutingFormProjectType extends
029: PersistableBusinessObjectBase {
030:
031: private String projectTypeCode;
032: private String documentNumber;
033: private boolean projectTypeSelectedIndicator;
034:
035: private ProjectType projectType;
036:
037: /**
038: * Default constructor.
039: */
040: public RoutingFormProjectType() {
041:
042: }
043:
044: /**
045: * Constructs a RoutingFormProjectType.
046: *
047: * @param documentNumber
048: * @param projectType
049: */
050: public RoutingFormProjectType(String documentNumber,
051: ProjectType projectType) {
052: this ();
053: this .documentNumber = documentNumber;
054: this .projectTypeCode = projectType.getProjectTypeCode();
055: this .projectType = projectType;
056: }
057:
058: /**
059: * Constructs with projectTypeCode argument.
060: *
061: * @param projectTypeCode
062: */
063: public RoutingFormProjectType(String projectTypeCode) {
064: this .projectTypeCode = projectTypeCode;
065: }
066:
067: /**
068: * Gets the projectTypeCode attribute.
069: *
070: * @return Returns the projectTypeCode
071: */
072: public String getProjectTypeCode() {
073: return projectTypeCode;
074: }
075:
076: /**
077: * Sets the projectTypeCode attribute.
078: *
079: * @param projectTypeCode The projectTypeCode to set.
080: */
081: public void setProjectTypeCode(String projectTypeCode) {
082: this .projectTypeCode = projectTypeCode;
083: }
084:
085: /**
086: * Gets the documentNumber attribute.
087: *
088: * @return Returns the documentNumber
089: */
090: public String getDocumentNumber() {
091: return documentNumber;
092: }
093:
094: /**
095: * Sets the documentNumber attribute.
096: *
097: * @param documentNumber The documentNumber to set.
098: */
099: public void setDocumentNumber(String documentNumber) {
100: this .documentNumber = documentNumber;
101: }
102:
103: /**
104: * Gets the projectTypeSelectedIndicator attribute.
105: *
106: * @return Returns the projectTypeSelectedIndicator.
107: */
108: public boolean isProjectTypeSelectedIndicator() {
109: return projectTypeSelectedIndicator;
110: }
111:
112: /**
113: * Sets the projectTypeSelectedIndicator attribute value.
114: *
115: * @param projectTypeSelectedIndicator The projectTypeSelectedIndicator to set.
116: */
117: public void setProjectTypeSelectedIndicator(
118: boolean projectTypeSelectedIndicator) {
119: this .projectTypeSelectedIndicator = projectTypeSelectedIndicator;
120: }
121:
122: /**
123: * Gets the projectType attribute.
124: *
125: * @return Returns the projectType.
126: */
127: public ProjectType getProjectType() {
128: return projectType;
129: }
130:
131: /**
132: * Sets the projectType attribute value.
133: *
134: * @param projectType The projectType to set.
135: * @deprecated
136: */
137: public void setProjectType(ProjectType projectType) {
138: this .projectType = projectType;
139: }
140:
141: /**
142: * @see java.lang.Object#equals(java.lang.Object)
143: */
144: public boolean equals(Object obj) {
145: boolean equals = false;
146:
147: if (ObjectUtils.isNotNull(obj)
148: && obj instanceof RoutingFormProjectType) {
149: RoutingFormProjectType routingFormProjectType = (RoutingFormProjectType) obj;
150:
151: equals = this .projectTypeCode.equals(routingFormProjectType
152: .getProjectTypeCode());
153: }
154:
155: return equals;
156: }
157:
158: /**
159: * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
160: */
161: protected LinkedHashMap toStringMapper() {
162: LinkedHashMap m = new LinkedHashMap();
163: m.put("projectTypeCode", this .projectTypeCode);
164: m
165: .put(KFSPropertyConstants.DOCUMENT_NUMBER,
166: this .documentNumber);
167: return m;
168: }
169:
170: /**
171: * @see java.lang.Object#hashCode()
172: */
173: public int hashCode() {
174: String hashString = this .getDocumentNumber() + "|"
175: + this .getProjectTypeCode() + "|"
176: + this.getDocumentNumber();
177: return hashString.hashCode();
178: }
179: }
|