001/*
002 * Copyright 2006 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
017package org.kuali.ole.module.cg.businessobject;
018
019import java.util.LinkedHashMap;
020
021import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
022import org.kuali.rice.core.api.util.type.KualiDecimal;
023import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
024
025/**
026 * This class represents an association between an award and a subcontractor. It's like a reference to the subcontractor from the
027 * award. This way an award can maintain a collection of these references instead of owning subcontractors directly.
028 */
029public class AwardSubcontractor extends PersistableBusinessObjectBase implements MutableInactivatable {
030
031    private String awardSubcontractorAmendmentNumber;
032    private String awardSubcontractorNumber;
033    private String subcontractorNumber;
034    private Long proposalNumber;
035    private KualiDecimal subcontractorAmount;
036    private String subcontractorContactFirstName;
037    private String subcontractorContactLastName;
038    private String subcontractorAuditHistoryText;
039    private String awardSubcontractorDescription;
040    private boolean active = true;
041
042    private SubContractor subcontractor;
043
044    /**
045     * Default constructor.
046     */
047    public AwardSubcontractor() {
048    }
049
050    /**
051     * Gets the awardSubcontractorAmendmentNumber attribute.
052     * 
053     * @return Returns the awardSubcontractorAmendmentNumber
054     */
055    public String getAwardSubcontractorAmendmentNumber() {
056        return awardSubcontractorAmendmentNumber;
057    }
058
059    /**
060     * Sets the awardSubcontractorAmendmentNumber attribute.
061     * 
062     * @param awardSubcontractorAmendmentNumber The awardSubcontractorAmendmentNumber to set.
063     */
064    public void setAwardSubcontractorAmendmentNumber(String awardSubcontractorAmendmentNumber) {
065        this.awardSubcontractorAmendmentNumber = awardSubcontractorAmendmentNumber;
066    }
067
068
069    /**
070     * Gets the awardSubcontractorNumber attribute.
071     * 
072     * @return Returns the awardSubcontractorNumber
073     */
074    public String getAwardSubcontractorNumber() {
075        return awardSubcontractorNumber;
076    }
077
078    /**
079     * Sets the awardSubcontractorNumber attribute.
080     * 
081     * @param awardSubcontractorNumber The awardSubcontractorNumber to set.
082     */
083    public void setAwardSubcontractorNumber(String awardSubcontractorNumber) {
084        this.awardSubcontractorNumber = awardSubcontractorNumber;
085    }
086
087
088    /**
089     * Gets the subcontractorNumber attribute.
090     * 
091     * @return Returns the subcontractorNumber
092     */
093    public String getSubcontractorNumber() {
094        return subcontractorNumber;
095    }
096
097    /**
098     * Sets the subcontractorNumber attribute.
099     * 
100     * @param subcontractorNumber The subcontractorNumber to set.
101     */
102    public void setSubcontractorNumber(String subcontractorNumber) {
103        this.subcontractorNumber = subcontractorNumber;
104    }
105
106
107    /**
108     * Gets the proposalNumber attribute.
109     * 
110     * @return Returns the proposalNumber
111     */
112    public Long getProposalNumber() {
113        return proposalNumber;
114    }
115
116    /**
117     * Sets the proposalNumber attribute.
118     * 
119     * @param proposalNumber The proposalNumber to set.
120     */
121    public void setProposalNumber(Long proposalNumber) {
122        this.proposalNumber = proposalNumber;
123    }
124
125
126    /**
127     * Gets the subcontractorAmount attribute.
128     * 
129     * @return Returns the subcontractorAmount
130     */
131    public KualiDecimal getSubcontractorAmount() {
132        return subcontractorAmount;
133    }
134
135    /**
136     * Sets the subcontractorAmount attribute.
137     * 
138     * @param subcontractorAmount The subcontractorAmount to set.
139     */
140    public void setSubcontractorAmount(KualiDecimal subcontractorAmount) {
141        this.subcontractorAmount = subcontractorAmount;
142    }
143
144
145    /**
146     * Gets the subcontractorContactFirstName attribute.
147     * 
148     * @return Returns the subcontractorContactFirstName
149     */
150    public String getSubcontractorContactFirstName() {
151        return subcontractorContactFirstName;
152    }
153
154    /**
155     * Sets the subcontractorContactFirstName attribute.
156     * 
157     * @param subcontractorContactFirstName The subcontractorContactFirstName to set.
158     */
159    public void setSubcontractorContactFirstName(String subcontractorContactFirstName) {
160        this.subcontractorContactFirstName = subcontractorContactFirstName;
161    }
162
163
164    /**
165     * Gets the subcontractorContactLastName attribute.
166     * 
167     * @return Returns the subcontractorContactLastName
168     */
169    public String getSubcontractorContactLastName() {
170        return subcontractorContactLastName;
171    }
172
173    /**
174     * Sets the subcontractorContactLastName attribute.
175     * 
176     * @param subcontractorContactLastName The subcontractorContactLastName to set.
177     */
178    public void setSubcontractorContactLastName(String subcontractorContactLastName) {
179        this.subcontractorContactLastName = subcontractorContactLastName;
180    }
181
182
183    /**
184     * Gets the subcontractorAuditHistoryText attribute.
185     * 
186     * @return Returns the subcontractorAuditHistoryText
187     */
188    public String getSubcontractorAuditHistoryText() {
189        return subcontractorAuditHistoryText;
190    }
191
192    /**
193     * Sets the subcontractorAuditHistoryText attribute.
194     * 
195     * @param subcontractorAuditHistoryText The subcontractorAuditHistoryText to set.
196     */
197    public void setSubcontractorAuditHistoryText(String subcontractorAuditHistoryText) {
198        this.subcontractorAuditHistoryText = subcontractorAuditHistoryText;
199    }
200
201    /**
202     * Gets the awardSubcontractorDescription attribute.
203     * 
204     * @return Returns the awardSubcontractorDescription.
205     */
206    public String getAwardSubcontractorDescription() {
207        return awardSubcontractorDescription;
208    }
209
210    /**
211     * Sets the awardSubcontractorDescription attribute value.
212     * 
213     * @param awardSubcontractorDescription The awardSubcontractorDescription to set.
214     */
215    public void setAwardSubcontractorDescription(String awardSubcontractorDescription) {
216        this.awardSubcontractorDescription = awardSubcontractorDescription;
217    }
218
219    /**
220     * Gets the subcontractor attribute.
221     * 
222     * @return Returns the subcontractor.
223     */
224    public SubContractor getSubcontractor() {
225        return subcontractor;
226    }
227
228    /**
229     * Sets the subcontractor attribute.
230     * 
231     * @param subcontractor The subcontractor to set.
232     * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
233     *             creation of the object and should not be changed.
234     */
235    @Deprecated
236    public void setSubcontractor(SubContractor subcontractor) {
237        this.subcontractor = subcontractor;
238    }
239
240    /**
241     * @see org.kuali.rice.core.api.mo.common.active.MutableInactivatable#setActive(boolean)
242     */
243    public void setActive(boolean active) {
244        this.active = active;
245    }
246
247    /**
248     * @see org.kuali.rice.core.api.mo.common.active.MutableInactivatable#isActive()
249     */
250    public boolean isActive() {
251        return active;
252    }
253
254    /**
255     * @see org.kuali.rice.krad.bo.BusinessObjectBase#toStringMapper()
256     */
257    @SuppressWarnings("unchecked")
258    
259    protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
260        LinkedHashMap m = new LinkedHashMap();
261        m.put("awardSubcontractorAmendmentNumber", this.awardSubcontractorAmendmentNumber);
262        m.put("awardSubcontractorNumber", this.awardSubcontractorNumber);
263        m.put("subcontractorNumber", this.subcontractorNumber);
264        if (this.proposalNumber != null) {
265            m.put("proposalNumber", this.proposalNumber.toString());
266        }
267        return m;
268    }
269
270}