View Javadoc

1   /**
2    * Copyright 2004-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.kpme.tklm.leave.donation;
17  
18  import java.math.BigDecimal;
19  
20  import org.kuali.kpme.core.accrualcategory.AccrualCategory;
21  import org.kuali.kpme.core.bo.HrBusinessObject;
22  import org.kuali.kpme.core.earncode.EarnCode;
23  import org.kuali.kpme.tklm.api.leave.donation.LeaveDonationContract;
24  import org.kuali.kpme.tklm.common.TkConstants;
25  import org.kuali.rice.kim.api.identity.Person;
26  
27  import com.google.common.collect.ImmutableList;
28  
29  public class LeaveDonation extends HrBusinessObject implements LeaveDonationContract {
30      public static final String CACHE_NAME = TkConstants.CacheNamespace.NAMESPACE_PREFIX + "LeaveDonation";
31      private static final long serialVersionUID = 1L;
32      //KPME-2273/1965 Primary Business Keys List.	
33      public static final ImmutableList<String> EQUAL_TO_FIELDS = new ImmutableList.Builder<String>()
34              .add("donorsPrincipalID")
35              .add("donatedAccrualCategory")
36              .add("amountDonated")
37              .add("recipientsPrincipalID")
38              .add("recipientsAccrualCategory")
39              .add("amountReceived")
40              .build();    
41      
42      private String lmLeaveDonationId;
43  	private String donatedAccrualCategory;
44  	private String recipientsAccrualCategory;
45  	private BigDecimal amountDonated = new BigDecimal("0.0");
46  	private BigDecimal amountReceived = new BigDecimal("0.0");
47  	private String donorsPrincipalID;
48  	private String recipientsPrincipalID;
49  	private String description;
50  	
51  	private Boolean history;
52  	
53  	private transient AccrualCategory accrualCategoryObj;
54  	private transient Person personObj;
55  	private transient EarnCode earnCodeObj;
56  	
57  	private String donatedEarnCode;
58  	private String recipientsEarnCode;
59  
60  	public EarnCode getEarnCodeObj() {
61  		return earnCodeObj;
62  	}
63  
64  	public void setEarnCodeObj(EarnCode earnCodeObj) {
65  		this.earnCodeObj = earnCodeObj;
66  	}
67  
68  	public String getDonatedEarnCode() {
69  		return donatedEarnCode;
70  	}
71  
72  	public void setDonatedEarnCode(String donatedEarnCode) {
73  		this.donatedEarnCode = donatedEarnCode;
74  	}
75  
76  	public String getRecipientsEarnCode() {
77  		return recipientsEarnCode;
78  	}
79  
80  	public void setRecipientsEarnCode(String recipientsEarnCode) {
81  		this.recipientsEarnCode = recipientsEarnCode;
82  	}
83  
84  	public String getLmLeaveDonationId() {
85  		return lmLeaveDonationId;
86  	}
87  
88  	public void setLmLeaveDonationId(String lmLeaveDonationId) {
89  		this.lmLeaveDonationId = lmLeaveDonationId;
90  	}
91  
92  	public String getDonatedAccrualCategory() {
93  		return donatedAccrualCategory;
94  	}
95  
96  	public void setDonatedAccrualCategory(String donatedAccrualCategory) {
97  		this.donatedAccrualCategory = donatedAccrualCategory;
98  	}
99  
100 	public String getRecipientsAccrualCategory() {
101 		return recipientsAccrualCategory;
102 	}
103 
104 	public void setRecipientsAccrualCategory(String recipientsAccrualCategory) {
105 		this.recipientsAccrualCategory = recipientsAccrualCategory;
106 	}
107 
108 	public BigDecimal getAmountDonated() {
109 		return amountDonated;
110 	}
111 
112 	public void setAmountDonated(BigDecimal amountDonated) {
113 		this.amountDonated = amountDonated;
114 	}
115 
116 	public BigDecimal getAmountReceived() {
117 		return amountReceived;
118 	}
119 
120 	public void setAmountReceived(BigDecimal amountReceived) {
121 		this.amountReceived = amountReceived;
122 	}
123 
124 	public String getDonorsPrincipalID() {
125 		return donorsPrincipalID;
126 	}
127 
128 	public void setDonorsPrincipalID(String donorsPrincipalID) {
129 		this.donorsPrincipalID = donorsPrincipalID;
130 	}
131 
132 	public String getRecipientsPrincipalID() {
133 		return recipientsPrincipalID;
134 	}
135 
136 	public void setRecipientsPrincipalID(String recipientsPrincipalID) {
137 		this.recipientsPrincipalID = recipientsPrincipalID;
138 	}
139 
140 	public String getDescription() {
141 		return description;
142 	}
143 
144 	public void setDescription(String description) {
145 		this.description = description;
146 	}
147 
148 	public Boolean getHistory() {
149 		return history;
150 	}
151 
152 	public void setHistory(Boolean history) {
153 		this.history = history;
154 	}
155 
156 	public Person getPersonObj() {
157 		return personObj;
158 	}
159 
160 	public void setPersonObj(Person personObj) {
161 		this.personObj = personObj;
162 	}
163 
164 	public AccrualCategory getAccrualCategoryObj() {
165 		return accrualCategoryObj;
166 	}
167 
168 	public void setAccrualCategoryObj(AccrualCategory accrualCategoryObj) {
169 		this.accrualCategoryObj = accrualCategoryObj;
170 	}
171 
172 	@Override
173 	protected String getUniqueKey() {
174 		return getDonorsPrincipalID() +"_"+ getRecipientsPrincipalID() +"_"+ getDonatedAccrualCategory() +"_"+ getRecipientsAccrualCategory();
175 	}
176 
177 	@Override
178 	public String getId() {
179 		return getLmLeaveDonationId();
180 	}
181 
182 	@Override
183 	public void setId(String id) {
184 		setLmLeaveDonationId(id);
185 	}
186 
187 }