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 package org.kuali.kfs.module.purap.util; 017 018 /** 019 * 020 * Expired or Closed Account 021 */ 022 public class ExpiredOrClosedAccount { 023 024 private String chartOfAccountsCode; 025 private String accountNumber; 026 private String subAccountNumber; 027 private boolean closedIndicator; 028 private boolean expiredIndicator; 029 private boolean continuationAccountMissing; 030 031 /** 032 * 033 * Default constructor 034 */ 035 public ExpiredOrClosedAccount() { 036 } 037 038 /** 039 * 040 * Constructs an Expired Or Closed Account consisting of the following attributes. 041 * @param chartOfAccountsCode chart 042 * @param accountNumber account 043 * @param subAccountNumber subAccount 044 */ 045 public ExpiredOrClosedAccount(String chartOfAccountsCode, String accountNumber, String subAccountNumber) { 046 setChartOfAccountsCode(chartOfAccountsCode); 047 setAccountNumber(accountNumber); 048 setSubAccountNumber(subAccountNumber); 049 } 050 051 public String getAccountNumber() { 052 return accountNumber; 053 } 054 055 public void setAccountNumber(String accountNumber) { 056 this.accountNumber = accountNumber; 057 } 058 059 public String getChartOfAccountsCode() { 060 return chartOfAccountsCode; 061 } 062 063 public void setChartOfAccountsCode(String chartOfAccountsCode) { 064 this.chartOfAccountsCode = chartOfAccountsCode; 065 } 066 067 public boolean isClosedIndicator() { 068 return closedIndicator; 069 } 070 071 public void setClosedIndicator(boolean closedIndicator) { 072 this.closedIndicator = closedIndicator; 073 } 074 075 public boolean isContinuationAccountMissing() { 076 return continuationAccountMissing; 077 } 078 079 public void setContinuationAccountMissing(boolean continuationAccountMissing) { 080 this.continuationAccountMissing = continuationAccountMissing; 081 } 082 083 public boolean isExpiredIndicator() { 084 return expiredIndicator; 085 } 086 087 public void setExpiredIndicator(boolean expiredIndicator) { 088 this.expiredIndicator = expiredIndicator; 089 } 090 091 public String getSubAccountNumber() { 092 return subAccountNumber; 093 } 094 095 public void setSubAccountNumber(String subAccountNumber) { 096 this.subAccountNumber = subAccountNumber; 097 } 098 099 /** 100 * This is a helper method to return the account as a string in the format chart-account-subaccount. 101 * 102 * @return account string representation 103 */ 104 public String getAccountString() { 105 StringBuffer accountStr = new StringBuffer(""); 106 107 if (getChartOfAccountsCode() != null) { 108 accountStr.append(getChartOfAccountsCode()); 109 } 110 111 if (getAccountNumber() != null) { 112 accountStr.append("-"); 113 accountStr.append(getAccountNumber()); 114 } 115 116 if (getSubAccountNumber() != null) { 117 accountStr.append("-"); 118 accountStr.append(getSubAccountNumber()); 119 } 120 121 return accountStr.toString(); 122 } 123 }