001package org.kuali.ole;
002
003/**
004 * Created by IntelliJ IDEA.
005 * User: palanivel
006 * Date: 3/8/12
007 * Time: 3:59 PM
008 * To change this template use File | Settings | File Templates.
009 */
010
011import org.kuali.ole.pojo.edi.BuyerInformation;
012
013public enum BuyerInformationFixture {
014    BuyerInformation("DUL-WCS",
015            null,
016            "ZZ"
017    ),;
018
019    private String buyerCodeIdentification;
020    private String buyerPartyIdentificationCode;
021    private String buyerCodeListAgency;
022
023    private BuyerInformationFixture(String buyerCodeIdentification, String buyerPartyIdentificationCode,
024                                    String buyerCodeListAgency) {
025        this.buyerCodeIdentification = buyerCodeIdentification;
026        this.buyerPartyIdentificationCode = buyerPartyIdentificationCode;
027        this.buyerCodeListAgency = buyerCodeListAgency;
028    }
029
030    public BuyerInformation createBuyerInformation(Class clazz) {
031        BuyerInformation buyerInformation = null;
032        try {
033            buyerInformation = (BuyerInformation) clazz.newInstance();
034        } catch (InstantiationException e) {
035            throw new RuntimeException("BuyerInformation creation failed. class = " + clazz);
036        } catch (IllegalAccessException e) {
037            throw new RuntimeException("BuyerInformation creation failed. class = " + clazz);
038        }
039        buyerInformation.setBuyerCodeIdentification(buyerCodeIdentification);
040        buyerInformation.setBuyerPartyIdentificationCode(buyerPartyIdentificationCode);
041        buyerInformation.setBuyerCodeListAgency(buyerCodeListAgency);
042        return buyerInformation;
043    }
044
045}