001: /*
002: * Copyright 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: package org.kuali.module.pdp.bo;
017:
018: import java.util.LinkedHashMap;
019:
020: import org.kuali.core.bo.PersistableBusinessObjectBase;
021: import org.kuali.kfs.bo.State;
022:
023: public class AchBank extends PersistableBusinessObjectBase {
024:
025: private String bankRoutingNumber;
026: private String bankOfficeCode;
027: private String bankServiceNumber;
028: private String bankTypeCode;
029: private String bankNewRoutingNumber;
030: private String bankName;
031: private String bankStreetAddress;
032: private String bankCityName;
033: private String bankStateCode;
034: private String bankZipCode;
035: private String bankZipExtensionCode;
036: private String bankPhoneAreaCode;
037: private String bankPhonePrefixNumber;
038: private String bankPhoneSuffixNumber;
039: private String bankInstitutionStatusCode;
040: private String bankDataViewCode;
041:
042: private State bankState;
043:
044: /**
045: * Default constructor.
046: */
047: public AchBank() {
048:
049: }
050:
051: /**
052: * This constructor takes a line of data from https://www.fededirectory.frb.org/FedACHdir.txt and populates the object
053: *
054: * @param fileData
055: */
056: public AchBank(String fileData) {
057: // 074914274O0710003011020207000000000UNITED COMMERCE BANK 211 SOUTH COLLEGE AVENUE BLOOMINGTON IN474040000812336226511
058: // Routing Number 9 1-9 The institution's routing number
059: // Office Code 1 10 Main office or branch O=main B=branch
060: // Servicing FRB Number 9 11-19 Servicing Fed's main office routing number
061: // Record Type Code 1 20 The code indicating the ABA number to be used to route or send ACH items to the RFI
062: // 0 = Institution is a Federal Reserve Bank
063: // 1 = Send items to customer routing number
064: // 2 = Send items to customer using new routing number field
065: // Change Date 6 21-26 Date of last change to CRF information (MMDDYY)
066: // New Routing Number 9 27-35 Institution's new routing number resulting from a merger or renumber
067: // Customer Name 36 36-71 Commonly used abbreviated name
068: // Address 36 72-107 Delivery address
069: // City 20 108-127 City name in the delivery address
070: // State Code 2 128-129 State code of the state in the delivery address
071: // Zipcode 5 130-134 Zip code in the delivery address
072: // Zipcode Extension 4 135-138 Zip code extension in the delivery address
073: // Telephone Area Code 3 139-141 Area code of the CRF contact telephone number
074: // Telephone Prefix Number 3 142-144 Prefix of the CRF contact telephone number
075: // Telephone Suffix Number 4 145-148 Suffix of the CRF contact telephone number
076: // Institution Status Code 1 149 Code is based on the customers receiver code
077: // 1=Receives Gov/Comm
078: // Data View Code 1 150 1=Current view
079: // Filler 5 151-155 Spaces
080:
081: setBankRoutingNumber(getField(fileData, 1, 9));
082: setBankOfficeCode(getField(fileData, 10, 1));
083: setBankServiceNumber(getField(fileData, 11, 9));
084: setBankTypeCode(getField(fileData, 20, 1));
085: setBankNewRoutingNumber(getField(fileData, 27, 9));
086: setBankName(getField(fileData, 36, 36));
087: setBankStreetAddress(getField(fileData, 72, 36));
088: setBankCityName(getField(fileData, 108, 20));
089: setBankStateCode(getField(fileData, 128, 2));
090: setBankZipCode(getField(fileData, 130, 5));
091: setBankZipExtensionCode(getField(fileData, 135, 4));
092: setBankPhoneAreaCode(getField(fileData, 139, 3));
093: setBankPhonePrefixNumber(getField(fileData, 142, 3));
094: setBankPhoneSuffixNumber(getField(fileData, 145, 4));
095: setBankInstitutionStatusCode(getField(fileData, 149, 1));
096: setBankDataViewCode(getField(fileData, 150, 1));
097: }
098:
099: private String getField(String data, int startChar, int length) {
100: return data.substring(startChar - 1, startChar + length - 1)
101: .trim();
102: }
103:
104: /**
105: * Gets the bankRoutingNumber attribute.
106: *
107: * @return Returns the bankRoutingNumber
108: */
109: public String getBankRoutingNumber() {
110: return bankRoutingNumber;
111: }
112:
113: /**
114: * Sets the bankRoutingNumber attribute.
115: *
116: * @param bankRoutingNumber The bankRoutingNumber to set.
117: */
118: public void setBankRoutingNumber(String bankRoutingNumber) {
119: this .bankRoutingNumber = bankRoutingNumber;
120: }
121:
122: /**
123: * Gets the bankOfficeCode attribute.
124: *
125: * @return Returns the bankOfficeCode
126: */
127: public String getBankOfficeCode() {
128: return bankOfficeCode;
129: }
130:
131: /**
132: * Sets the bankOfficeCode attribute.
133: *
134: * @param bankOfficeCode The bankOfficeCode to set.
135: */
136: public void setBankOfficeCode(String bankOfficeCode) {
137: this .bankOfficeCode = bankOfficeCode;
138: }
139:
140: /**
141: * Gets the bankServiceNumber attribute.
142: *
143: * @return Returns the bankServiceNumber
144: */
145: public String getBankServiceNumber() {
146: return bankServiceNumber;
147: }
148:
149: /**
150: * Sets the bankServiceNumber attribute.
151: *
152: * @param bankServiceNumber The bankServiceNumber to set.
153: */
154: public void setBankServiceNumber(String bankServiceNumber) {
155: this .bankServiceNumber = bankServiceNumber;
156: }
157:
158: /**
159: * Gets the bankTypeCode attribute.
160: *
161: * @return Returns the bankTypeCode
162: */
163: public String getBankTypeCode() {
164: return bankTypeCode;
165: }
166:
167: /**
168: * Sets the bankTypeCode attribute.
169: *
170: * @param bankTypeCode The bankTypeCode to set.
171: */
172: public void setBankTypeCode(String bankTypeCode) {
173: this .bankTypeCode = bankTypeCode;
174: }
175:
176: /**
177: * Gets the bankNewRoutingNumber attribute.
178: *
179: * @return Returns the bankNewRoutingNumber
180: */
181: public String getBankNewRoutingNumber() {
182: return bankNewRoutingNumber;
183: }
184:
185: /**
186: * Sets the bankNewRoutingNumber attribute.
187: *
188: * @param bankNewRoutingNumber The bankNewRoutingNumber to set.
189: */
190: public void setBankNewRoutingNumber(String bankNewRoutingNumber) {
191: this .bankNewRoutingNumber = bankNewRoutingNumber;
192: }
193:
194: /**
195: * Gets the bankName attribute.
196: *
197: * @return Returns the bankName
198: */
199: public String getBankName() {
200: return bankName;
201: }
202:
203: /**
204: * Sets the bankName attribute.
205: *
206: * @param bankName The bankName to set.
207: */
208: public void setBankName(String bankName) {
209: this .bankName = bankName;
210: }
211:
212: /**
213: * Gets the bankStreetAddress attribute.
214: *
215: * @return Returns the bankStreetAddress
216: */
217: public String getBankStreetAddress() {
218: return bankStreetAddress;
219: }
220:
221: /**
222: * Sets the bankStreetAddress attribute.
223: *
224: * @param bankStreetAddress The bankStreetAddress to set.
225: */
226: public void setBankStreetAddress(String bankStreetAddress) {
227: this .bankStreetAddress = bankStreetAddress;
228: }
229:
230: /**
231: * Gets the bankCityName attribute.
232: *
233: * @return Returns the bankCityName
234: */
235: public String getBankCityName() {
236: return bankCityName;
237: }
238:
239: /**
240: * Sets the bankCityName attribute.
241: *
242: * @param bankCityName The bankCityName to set.
243: */
244: public void setBankCityName(String bankCityName) {
245: this .bankCityName = bankCityName;
246: }
247:
248: /**
249: * Gets the bankStateCode attribute.
250: *
251: * @return Returns the bankStateCode
252: */
253: public String getBankStateCode() {
254: return bankStateCode;
255: }
256:
257: /**
258: * Sets the bankStateCode attribute.
259: *
260: * @param bankStateCode The bankStateCode to set.
261: */
262: public void setBankStateCode(String bankStateCode) {
263: this .bankStateCode = bankStateCode;
264: }
265:
266: /**
267: * Gets the bankZipCode attribute.
268: *
269: * @return Returns the bankZipCode
270: */
271: public String getBankZipCode() {
272: return bankZipCode;
273: }
274:
275: /**
276: * Sets the bankZipCode attribute.
277: *
278: * @param bankZipCode The bankZipCode to set.
279: */
280: public void setBankZipCode(String bankZipCode) {
281: this .bankZipCode = bankZipCode;
282: }
283:
284: /**
285: * Gets the bankZipExtensionCode attribute.
286: *
287: * @return Returns the bankZipExtensionCode
288: */
289: public String getBankZipExtensionCode() {
290: return bankZipExtensionCode;
291: }
292:
293: /**
294: * Sets the bankZipExtensionCode attribute.
295: *
296: * @param bankZipExtensionCode The bankZipExtensionCode to set.
297: */
298: public void setBankZipExtensionCode(String bankZipExtensionCode) {
299: this .bankZipExtensionCode = bankZipExtensionCode;
300: }
301:
302: /**
303: * Gets the bankPhoneAreaCode attribute.
304: *
305: * @return Returns the bankPhoneAreaCode
306: */
307: public String getBankPhoneAreaCode() {
308: return bankPhoneAreaCode;
309: }
310:
311: /**
312: * Sets the bankPhoneAreaCode attribute.
313: *
314: * @param bankPhoneAreaCode The bankPhoneAreaCode to set.
315: */
316: public void setBankPhoneAreaCode(String bankPhoneAreaCode) {
317: this .bankPhoneAreaCode = bankPhoneAreaCode;
318: }
319:
320: /**
321: * Gets the bankPhonePrefixNumber attribute.
322: *
323: * @return Returns the bankPhonePrefixNumber
324: */
325: public String getBankPhonePrefixNumber() {
326: return bankPhonePrefixNumber;
327: }
328:
329: /**
330: * Sets the bankPhonePrefixNumber attribute.
331: *
332: * @param bankPhonePrefixNumber The bankPhonePrefixNumber to set.
333: */
334: public void setBankPhonePrefixNumber(String bankPhonePrefixNumber) {
335: this .bankPhonePrefixNumber = bankPhonePrefixNumber;
336: }
337:
338: /**
339: * Gets the bankPhoneSuffixNumber attribute.
340: *
341: * @return Returns the bankPhoneSuffixNumber
342: */
343: public String getBankPhoneSuffixNumber() {
344: return bankPhoneSuffixNumber;
345: }
346:
347: /**
348: * Sets the bankPhoneSuffixNumber attribute.
349: *
350: * @param bankPhoneSuffixNumber The bankPhoneSuffixNumber to set.
351: */
352: public void setBankPhoneSuffixNumber(String bankPhoneSuffixNumber) {
353: this .bankPhoneSuffixNumber = bankPhoneSuffixNumber;
354: }
355:
356: /**
357: * Gets the bankInstitutionStatusCode attribute.
358: *
359: * @return Returns the bankInstitutionStatusCode
360: */
361: public String getBankInstitutionStatusCode() {
362: return bankInstitutionStatusCode;
363: }
364:
365: /**
366: * Sets the bankInstitutionStatusCode attribute.
367: *
368: * @param bankInstitutionStatusCode The bankInstitutionStatusCode to set.
369: */
370: public void setBankInstitutionStatusCode(
371: String bankInstitutionStatusCode) {
372: this .bankInstitutionStatusCode = bankInstitutionStatusCode;
373: }
374:
375: /**
376: * Gets the bankDataViewCode attribute.
377: *
378: * @return Returns the bankDataViewCode
379: */
380: public String getBankDataViewCode() {
381: return bankDataViewCode;
382: }
383:
384: /**
385: * Sets the bankDataViewCode attribute.
386: *
387: * @param bankDataViewCode The bankDataViewCode to set.
388: */
389: public void setBankDataViewCode(String bankDataViewCode) {
390: this .bankDataViewCode = bankDataViewCode;
391: }
392:
393: /**
394: * Gets the bankState attribute.
395: *
396: * @return Returns the bankState.
397: */
398: public State getBankState() {
399: return bankState;
400: }
401:
402: /**
403: * Sets the bankState attribute value.
404: *
405: * @param bankState The bankState to set.
406: * @deprecated
407: */
408: public void setBankState(State bankState) {
409: this .bankState = bankState;
410: }
411:
412: /**
413: * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
414: */
415: protected LinkedHashMap toStringMapper() {
416: LinkedHashMap m = new LinkedHashMap();
417: m.put("bankRoutingNumber", this.bankRoutingNumber);
418: return m;
419: }
420:
421: }
|