001/*
002 * Copyright 2008 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 */
016package org.kuali.ole.module.purap.businessobject;
017
018
019import org.apache.commons.lang.builder.EqualsBuilder;
020import org.apache.commons.lang.builder.HashCodeBuilder;
021import org.kuali.rice.core.api.util.type.KualiDecimal;
022import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
023
024import java.util.LinkedHashMap;
025
026public abstract class PurApItemUseTaxBase extends PersistableBusinessObjectBase implements PurApItemUseTax {
027
028    private Integer useTaxId;
029    private Integer itemIdentifier;
030    private String rateCode;
031    private KualiDecimal taxAmount;
032    private String chartOfAccountsCode;
033    private String accountNumber;
034    private String financialObjectCode;
035
036    public PurApItemUseTaxBase() {
037        super();
038    }
039
040    public PurApItemUseTaxBase(PurApItemUseTax itemUseTax) {
041        super();
042        setAccountNumber(itemUseTax.getAccountNumber());
043        setChartOfAccountsCode(itemUseTax.getChartOfAccountsCode());
044        setFinancialObjectCode(itemUseTax.getFinancialObjectCode());
045        setRateCode(itemUseTax.getRateCode());
046        setTaxAmount(itemUseTax.getTaxAmount());
047    }
048
049    public String getAccountNumber() {
050        return accountNumber;
051    }
052
053    public void setAccountNumber(String accountNumber) {
054        this.accountNumber = accountNumber;
055    }
056
057    public String getChartOfAccountsCode() {
058        return chartOfAccountsCode;
059    }
060
061    public void setChartOfAccountsCode(String chartOfAccountsCode) {
062        this.chartOfAccountsCode = chartOfAccountsCode;
063    }
064
065    public String getFinancialObjectCode() {
066        return financialObjectCode;
067    }
068
069    public void setFinancialObjectCode(String financialObjectCode) {
070        this.financialObjectCode = financialObjectCode;
071    }
072
073    public Integer getItemIdentifier() {
074        return itemIdentifier;
075    }
076
077    public void setItemIdentifier(Integer itemIdentifier) {
078        this.itemIdentifier = itemIdentifier;
079    }
080
081    public Integer getUseTaxId() {
082        return useTaxId;
083    }
084
085    public void setUseTaxId(Integer useTaxId) {
086        this.useTaxId = useTaxId;
087    }
088
089    public String getRateCode() {
090        return rateCode;
091    }
092
093    public void setRateCode(String rateCode) {
094        this.rateCode = rateCode;
095    }
096
097    public KualiDecimal getTaxAmount() {
098        return taxAmount;
099    }
100
101    public void setTaxAmount(KualiDecimal taxAmount) {
102        this.taxAmount = taxAmount;
103    }
104
105    protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
106        LinkedHashMap m = new LinkedHashMap();
107        m.put("useTaxId", this.useTaxId);
108        return m;
109    }
110
111    /**
112     * Override needed for PURAP GL entry creation (hjs) - please do not add "amount" to this method
113     *
114     * @see java.lang.Object#equals(java.lang.Object)
115     */
116    public boolean equals(Object obj) {
117        if (!(obj instanceof PurApItemUseTaxBase)) {
118            return false;
119        }
120        PurApItemUseTax purapItemUseTax = (PurApItemUseTax) obj;
121        return new EqualsBuilder().append(this.chartOfAccountsCode, purapItemUseTax.getChartOfAccountsCode()).
122                append(this.accountNumber, purapItemUseTax.getAccountNumber()).
123                append(this.getRateCode(), purapItemUseTax.getRateCode()).
124                append(this.financialObjectCode, purapItemUseTax.getFinancialObjectCode()).isEquals();
125    }
126
127    /**
128     * Override needed for PURAP GL entry creation please do not add "taxAmount" to this method
129     *
130     * @see java.lang.Object#hashCode()
131     */
132    public int hashCode() {
133        return new HashCodeBuilder(55, 97).
134                append(this.chartOfAccountsCode).
135                append(this.accountNumber).
136                append(this.getRateCode()).
137                append(this.financialObjectCode).toHashCode();
138    }
139
140}