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.cg.bo;
018:
019: import java.util.LinkedHashMap;
020:
021: import org.kuali.core.bo.Inactivateable;
022: import org.kuali.core.bo.PersistableBusinessObjectBase;
023: import org.kuali.module.chart.bo.Chart;
024: import org.kuali.module.chart.bo.Org;
025:
026: /**
027: * This class represents an association between an award and an organization. It's like a reference to the organization from the
028: * award. This way an award can maintain a collection of these references instead of owning organizations directly.
029: */
030: public class AwardOrganization extends PersistableBusinessObjectBase
031: implements Primaryable, Inactivateable {
032:
033: private String chartOfAccountsCode;
034: private String organizationCode;
035: private Long proposalNumber;
036: private boolean awardPrimaryOrganizationIndicator;
037: private boolean active = true;
038:
039: private Chart chartOfAccounts;
040: private Org organization;
041:
042: /**
043: * Default no-args constructor.
044: */
045: public AwardOrganization() {
046:
047: }
048:
049: /**
050: * Gets the chartOfAccountsCode attribute.
051: *
052: * @return Returns the chartOfAccountsCode
053: */
054: public String getChartOfAccountsCode() {
055: return chartOfAccountsCode;
056: }
057:
058: /**
059: * Sets the chartOfAccountsCode attribute.
060: *
061: * @param chartOfAccountsCode The chartOfAccountsCode to set.
062: */
063: public void setChartOfAccountsCode(String chartOfAccountsCode) {
064: this .chartOfAccountsCode = chartOfAccountsCode;
065: }
066:
067: /**
068: * Gets the organizationCode attribute.
069: *
070: * @return Returns the organizationCode
071: */
072: public String getOrganizationCode() {
073: return organizationCode;
074: }
075:
076: /**
077: * Sets the organizationCode attribute.
078: *
079: * @param organizationCode The organizationCode to set.
080: */
081: public void setOrganizationCode(String organizationCode) {
082: this .organizationCode = organizationCode;
083: }
084:
085: /**
086: * Gets the proposalNumber attribute.
087: *
088: * @return Returns the proposalNumber
089: */
090: public Long getProposalNumber() {
091: return proposalNumber;
092: }
093:
094: /**
095: * Sets the proposalNumber attribute.
096: *
097: * @param proposalNumber The proposalNumber to set.
098: */
099: public void setProposalNumber(Long proposalNumber) {
100: this .proposalNumber = proposalNumber;
101: }
102:
103: /**
104: * Gets the awardPrimaryOrganizationIndicator attribute.
105: *
106: * @return Returns the awardPrimaryOrganizationIndicator
107: */
108: public boolean isAwardPrimaryOrganizationIndicator() {
109: return awardPrimaryOrganizationIndicator;
110: }
111:
112: /**
113: * Sets the awardPrimaryOrganizationIndicator attribute.
114: *
115: * @param awardPrimaryOrganizationIndicator The awardPrimaryOrganizationIndicator to set.
116: */
117: public void setAwardPrimaryOrganizationIndicator(
118: boolean awardPrimaryOrganizationIndicator) {
119: this .awardPrimaryOrganizationIndicator = awardPrimaryOrganizationIndicator;
120: }
121:
122: /**
123: * Gets the chartOfAccounts attribute.
124: *
125: * @return Returns the chartOfAccounts
126: */
127: public Chart getChartOfAccounts() {
128: return chartOfAccounts;
129: }
130:
131: /**
132: * Sets the chartOfAccounts attribute.
133: *
134: * @param chartOfAccounts The chartOfAccounts to set.
135: * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
136: * creation of the object and should not be changed.
137: */
138: @Deprecated
139: public void setChartOfAccounts(Chart chartOfAccounts) {
140: this .chartOfAccounts = chartOfAccounts;
141: }
142:
143: /**
144: * Gets the organization attribute.
145: *
146: * @return Returns the organization
147: */
148: public Org getOrganization() {
149: return organization;
150: }
151:
152: /**
153: * Sets the organization attribute.
154: *
155: * @param organization The organization to set.
156: * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
157: * creation of the object and should not be changed.
158: */
159: @Deprecated
160: public void setOrganization(Org organization) {
161: this .organization = organization;
162: }
163:
164: /**
165: * @see Primaryable#isPrimary()
166: */
167: public boolean isPrimary() {
168: return isAwardPrimaryOrganizationIndicator();
169: }
170:
171: /**
172: * @see org.kuali.core.bo.Inactivateable#isActive()
173: */
174: public boolean isActive() {
175: return active;
176: }
177:
178: /**
179: * @see org.kuali.core.bo.Inactivateable#setActive(boolean)
180: */
181: public void setActive(boolean active) {
182: this .active = active;
183: }
184:
185: /**
186: * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
187: */
188: @SuppressWarnings("unchecked")
189: @Override
190: protected LinkedHashMap toStringMapper() {
191: LinkedHashMap m = new LinkedHashMap();
192: m.put("chartOfAccountsCode", this .chartOfAccountsCode);
193: m.put("organizationCode", this .organizationCode);
194: if (this .proposalNumber != null) {
195: m.put("proposalNumber", this.proposalNumber.toString());
196: }
197: return m;
198: }
199: }
|