001 /*
002 * Copyright 2011 The Kuali Foundation.
003 *
004 * Licensed under the Educational Community License, Version 2.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/ecl2.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.kfs.module.ec.businessobject;
018
019 import java.util.ArrayList;
020 import java.util.LinkedHashMap;
021 import java.util.List;
022
023 import org.kuali.kfs.module.ec.EffortPropertyConstants;
024 import org.kuali.kfs.sys.KFSPropertyConstants;
025 import org.kuali.kfs.sys.ObjectUtil;
026
027 /**
028 * Business Object for the Effort Certification Detail Build Table.
029 */
030 public class EffortCertificationDetailBuild extends EffortCertificationDetail {
031 private Long effortCertificationBuildNumber;
032
033 private EffortCertificationDocumentBuild effortCertificationDocumentBuild;
034
035 /**
036 * Default constructor.
037 */
038 public EffortCertificationDetailBuild() {
039 super();
040 }
041
042 /**
043 * Gets the effortCertificationBuildNumber attribute.
044 *
045 * @return Returns the effortCertificationBuildNumber.
046 */
047 public Long getEffortCertificationBuildNumber() {
048 return effortCertificationBuildNumber;
049 }
050
051 /**
052 * Sets the effortCertificationBuildNumber attribute value.
053 *
054 * @param effortCertificationBuildNumber The effortCertificationBuildNumber to set.
055 */
056 public void setEffortCertificationBuildNumber(Long effortCertificationBuildNumber) {
057 this.effortCertificationBuildNumber = effortCertificationBuildNumber;
058 }
059
060 /**
061 * Gets the effortCertificationDocumentBuild attribute.
062 *
063 * @return Returns the effortCertificationDocumentBuild.
064 */
065 public EffortCertificationDocumentBuild getEffortCertificationDocumentBuild() {
066 return effortCertificationDocumentBuild;
067 }
068
069 /**
070 * Sets the effortCertificationDocumentBuild attribute value.
071 *
072 * @param effortCertificationDocumentBuild The effortCertificationDocumentBuild to set.
073 */
074 @Deprecated
075 public void setEffortCertificationDocumentBuild(EffortCertificationDocumentBuild effortCertificationDocumentBuild) {
076 this.effortCertificationDocumentBuild = effortCertificationDocumentBuild;
077 }
078
079 /**
080 * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
081 */
082 @SuppressWarnings("unchecked")
083 protected LinkedHashMap toStringMapper() {
084 LinkedHashMap m = super.toStringMapper();
085 if (this.effortCertificationBuildNumber != null) {
086 m.put("effortCertificationBuildNumber", this.effortCertificationBuildNumber.toString());
087 }
088 return m;
089 }
090
091 /**
092 * @see java.lang.Object#equals(java.lang.Object)
093 */
094 @Override
095 public boolean equals(Object otherEntry) {
096 return ObjectUtil.equals(this, otherEntry, getKeyList());
097 }
098
099 /**
100 * @see java.lang.Object#hashCode()
101 */
102 @Override
103 public int hashCode() {
104 return ObjectUtil.generateHashCode(this, getKeyList());
105 }
106
107 /**
108 * get the field name list of the key fields of the Class
109 *
110 * @return the field name list of the key fields of the Class
111 */
112 public static List<String> getKeyList() {
113 List<String> keyList = new ArrayList<String>();
114 keyList.add(EffortPropertyConstants.EFFORT_CERTIFICATION_BUILD_NUMBER);
115 keyList.add(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE);
116 keyList.add(KFSPropertyConstants.ACCOUNT_NUMBER);
117 keyList.add(KFSPropertyConstants.SUB_ACCOUNT_NUMBER);
118 keyList.add(KFSPropertyConstants.FINANCIAL_OBJECT_CODE);
119 keyList.add(KFSPropertyConstants.POSITION_NUMBER);
120 keyList.add(EffortPropertyConstants.SOURCE_CHART_OF_ACCOUNTS_CODE);
121 keyList.add(EffortPropertyConstants.SOURCE_ACCOUNT_NUMBER);
122 return keyList;
123 }
124 }