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.apache.commons.lang.StringUtils;
022: import org.kuali.core.bo.PersistableBusinessObjectBase;
023: import org.kuali.core.util.ObjectUtils;
024: import org.kuali.kfs.KFSPropertyConstants;
025:
026: /**
027: *
028: */
029: public class RoutingFormKeyword extends PersistableBusinessObjectBase {
030:
031: private String routingFormKeywordDescription;
032: private String documentNumber;
033:
034: /**
035: * Default constructor.
036: */
037: public RoutingFormKeyword() {
038:
039: }
040:
041: /**
042: * Constructs a RoutingFormKeyword.
043: *
044: * @param documentNumber
045: * @param keyword
046: */
047: public RoutingFormKeyword(String documentNumber, Keyword keyword) {
048: this .documentNumber = documentNumber;
049: this .routingFormKeywordDescription = keyword
050: .getRoutingFormKeywordDescription();
051: }
052:
053: /**
054: * Gets the routingFormKeywordDescription attribute.
055: *
056: * @return Returns the routingFormKeywordDescription
057: */
058: public String getRoutingFormKeywordDescription() {
059: return routingFormKeywordDescription;
060: }
061:
062: /**
063: * Sets the routingFormKeywordDescription attribute.
064: *
065: * @param routingFormKeywordDescription The routingFormKeywordDescription to set.
066: */
067: public void setRoutingFormKeywordDescription(
068: String routingFormKeywordDescription) {
069: this .routingFormKeywordDescription = routingFormKeywordDescription;
070: }
071:
072: /**
073: * Gets the documentNumber attribute.
074: *
075: * @return Returns the documentNumber
076: */
077: public String getDocumentNumber() {
078: return documentNumber;
079: }
080:
081: /**
082: * Sets the documentNumber attribute.
083: *
084: * @param documentNumber The documentNumber to set.
085: */
086: public void setDocumentNumber(String documentNumber) {
087: this .documentNumber = documentNumber;
088: }
089:
090: @Override
091: public boolean equals(Object obj) {
092: boolean equals = true;
093:
094: if (ObjectUtils.isNotNull(obj)
095: && obj instanceof RoutingFormKeyword) {
096: RoutingFormKeyword objCompare = (RoutingFormKeyword) obj;
097:
098: equals &= this .documentNumber.equals(objCompare
099: .getDocumentNumber());
100: equals &= this .routingFormKeywordDescription
101: .equals(objCompare
102: .getRoutingFormKeywordDescription());
103: }
104:
105: return equals;
106: }
107:
108: /**
109: * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
110: */
111: protected LinkedHashMap toStringMapper() {
112: LinkedHashMap m = new LinkedHashMap();
113: m.put("routingFormKeywordDescription",
114: this .routingFormKeywordDescription);
115: m
116: .put(KFSPropertyConstants.DOCUMENT_NUMBER,
117: this .documentNumber);
118: return m;
119: }
120:
121: public boolean isEmpty() {
122: return StringUtils.isBlank(documentNumber)
123: && StringUtils.isBlank(routingFormKeywordDescription);
124: }
125: }
|