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.vendor.fixtures;
017:
018: import static org.kuali.module.vendor.fixtures.VendorDefaultAddressFixture.campusIN;
019: import static org.kuali.module.vendor.fixtures.VendorDefaultAddressFixture.campusKO;
020: import static org.kuali.module.vendor.fixtures.VendorDefaultAddressFixture.campusSB;
021:
022: import java.util.ArrayList;
023: import java.util.List;
024:
025: import org.kuali.module.vendor.bo.VendorAddress;
026: import org.kuali.module.vendor.bo.VendorDefaultAddress;
027:
028: public enum VendorAddressFixture {
029:
030: address1(new Integer(1), "PO", "line1", "line2", "thisCity", "IN",
031: "44444", "US", "attentionTo", "",
032: "knoreceipt-l@indiana.edu", "", "555-555-5555", true, null), address2(
033: new Integer(2), "PO", "line1", "line2", "thisCity", "IN",
034: "44444", "US", "attentionTo", "",
035: "knoreceipt-l@indiana.edu", "", "555-555-5555", false,
036: new VendorDefaultAddressFixture[] { campusKO, campusIN }), address3(
037: new Integer(3), "RM", "line1", "line2", "thisCity", "IN",
038: "44444", "US", "attentionTo", "",
039: "knoreceipt-l@indiana.edu", "", "555-555-5555", true, null), address4(
040: new Integer(4), "RM", "line1", "line2", "thisCity", "IN",
041: "44444", "US", "attentionTo", "",
042: "knoreceipt-l@indiana.edu", "", "555-555-5555", false,
043: new VendorDefaultAddressFixture[] { campusSB }), ;
044:
045: public final Integer vendorAddressGeneratedIdentifier;
046: public final String vendorAddressTypeCode;
047: public final String vendorLine1Address;
048: public final String vendorLine2Address;
049: public final String vendorCityName;
050: public final String vendorStateCode;
051: public final String vendorZipCode;
052: public final String vendorCountryCode;
053: public final String vendorAttentionName;
054: public final String vendorAddressInternationalProvinceName;
055: public final String vendorAddressEmailAddress;
056: public final String vendorBusinessToBusinessUrlAddress;
057: public final String vendorFaxNumber;
058: public final boolean vendorDefaultAddressIndicator;
059: public final List defaultAddresses = new ArrayList();
060:
061: private VendorAddressFixture(
062: Integer vendorAddressGeneratedIdentifier,
063: String vendorAddressTypeCode, String vendorLine1Address,
064: String vendorLine2Address, String vendorCityName,
065: String vendorStateCode, String vendorZipCode,
066: String vendorCountryCode, String vendorAttentionName,
067: String vendorAddressInternationalProvinceName,
068: String vendorAddressEmailAddress,
069: String vendorBusinessToBusinessUrlAddress,
070: String vendorFaxNumber,
071: boolean vendorDefaultAddressIndicator,
072: VendorDefaultAddressFixture[] campuses) {
073: this .vendorAddressGeneratedIdentifier = vendorAddressGeneratedIdentifier;
074: this .vendorAddressTypeCode = vendorAddressTypeCode;
075: this .vendorLine1Address = vendorLine1Address;
076: this .vendorLine2Address = vendorLine2Address;
077: this .vendorCityName = vendorCityName;
078: this .vendorStateCode = vendorStateCode;
079: this .vendorZipCode = vendorZipCode;
080: this .vendorCountryCode = vendorCountryCode;
081: this .vendorAttentionName = vendorAttentionName;
082: this .vendorAddressInternationalProvinceName = vendorAddressInternationalProvinceName;
083: this .vendorAddressEmailAddress = vendorAddressEmailAddress;
084: this .vendorBusinessToBusinessUrlAddress = vendorBusinessToBusinessUrlAddress;
085: this .vendorFaxNumber = vendorFaxNumber;
086: this .vendorDefaultAddressIndicator = vendorDefaultAddressIndicator;
087: if (campuses != null) {
088: for (VendorDefaultAddressFixture campus : campuses) {
089: VendorDefaultAddress vda = new VendorDefaultAddress();
090: vda.setVendorCampusCode(campus.vendorCampusCode);
091: defaultAddresses.add(vda);
092: }
093: }
094: }
095:
096: public VendorAddress createAddress() {
097: VendorAddress address = new VendorAddress();
098: address
099: .setVendorAddressGeneratedIdentifier(this.vendorAddressGeneratedIdentifier);
100: address.setVendorAddressTypeCode(this.vendorAddressTypeCode);
101: address.setVendorLine1Address(this.vendorLine1Address);
102: address.setVendorLine2Address(this.vendorLine2Address);
103: address.setVendorCityName(this.vendorCityName);
104: address.setVendorStateCode(this.vendorStateCode);
105: address.setVendorZipCode(this.vendorZipCode);
106: address.setVendorCountryCode(this.vendorCountryCode);
107: address.setVendorAttentionName(this.vendorAttentionName);
108: address
109: .setVendorAddressInternationalProvinceName(this.vendorAddressInternationalProvinceName);
110: address
111: .setVendorAddressEmailAddress(this.vendorAddressEmailAddress);
112: address
113: .setVendorBusinessToBusinessUrlAddress(this.vendorBusinessToBusinessUrlAddress);
114: address.setVendorFaxNumber(this.vendorFaxNumber);
115: address
116: .setVendorDefaultAddressIndicator(this.vendorDefaultAddressIndicator);
117: address.setVendorDefaultAddresses(defaultAddresses);
118: return address;
119: }
120:
121: }
|