001package org.kuali.ole;
002
003import org.kuali.ole.pojo.edi.*;
004
005import java.util.ArrayList;
006import java.util.Arrays;
007import java.util.List;
008
009/**
010 * Created by IntelliJ IDEA.
011 * User: palanivel
012 * Date: 3/8/12
013 * Time: 8:31 PM
014 * To change this template use File | Settings | File Templates.
015 */
016public enum LineItemOrderFixture {
017    LINEITEM("1", null, "9783835309449", "EN", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null),
018    PRODUCTFUNCTION(null, null, null, null, "5", "3835309447", "IB", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null),
019    ITEMDESCRIPTION(null, null, null, null, null, null, null, "L", "050", ":::Ausnahmezustand der Literatur", null, null, null, null, null, null, null, null, null, null, null, null),
020    QUANTITYINFORMATION(null, null, null, null, null, null, null, null, null, null, "21", "1", null, null, null, null, null, null, null, null, null, null),
021    PRICEINFORMATION(null, null, null, null, null, null, null, null, null, null, null, null, "AAB", "34.07", null, null, null, null, null, null, null, null),
022    REFERENCEINFORMATION(null, null, null, null, null, null, null, null, null, null, null, null, null, null, "LI", "603634", null, null, null, null, null, null),
023    SUPPLIERSREFERENCEINFORMATION(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "SLI", "har110148705", null, null, null, null),
024    FUNDNUMBERREFERENCE(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "BFN", "PXXUXXXGRXXX631-2012", null, null),
025    TRANSPORTSTAGEQUALIFIER(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "20", "53"),;
026
027    private String sequenceNumber;
028    private String itemNumberId;
029    private String lineItemIsbn;
030    private String lineItemNumberType;
031    private String productId;
032    private String productIsbn;
033    private String productItemNumberType;
034    private String text;
035    private String itemCharacteristicCode;
036    private String data;
037    private String quantityConstant;
038    private String quantity;
039    private String grossPrice;
040    private String price;
041    private String buyersOrderLine;
042    private String orderLineNumber;
043    private String suppliersOrderLine;
044    private String vendorReferenceNumber;
045    private String buyersFundNumber;
046    private String budgetNumber;
047    private String transportStageConstant;
048    private String surfaceMail;
049
050    private LineItemOrderFixture(String sequenceNumber, String itemNumberId, String lineItemIsbn,
051                                 String lineItemNumberType, String productId, String productIsbn,
052                                 String productItemNumberType, String text, String itemCharacteristicCode,
053                                 String data, String quantityConstant, String quantity, String grossPrice,
054                                 String price, String buyersOrderLine, String orderLineNumber, String suppliersOrderLine,
055                                 String vendorReferenceNumber, String buyersFundNumber, String budgetNumber, String transportStageConstant,
056                                 String surfaceMail) {
057        this.sequenceNumber = sequenceNumber;
058        this.itemNumberId = itemNumberId;
059        this.lineItemIsbn = lineItemIsbn;
060        this.lineItemNumberType = lineItemNumberType;
061        this.productId = productId;
062        this.productIsbn = productIsbn;
063        this.productItemNumberType = productItemNumberType;
064        this.text = text;
065        this.itemCharacteristicCode = itemCharacteristicCode;
066        this.data = data;
067        this.quantityConstant = quantityConstant;
068        this.quantity = quantity;
069        this.grossPrice = grossPrice;
070        this.price = price;
071        this.buyersOrderLine = buyersOrderLine;
072        this.orderLineNumber = orderLineNumber;
073        this.suppliersOrderLine = suppliersOrderLine;
074        this.vendorReferenceNumber = vendorReferenceNumber;
075        this.buyersFundNumber = buyersFundNumber;
076        this.budgetNumber = budgetNumber;
077        this.transportStageConstant = transportStageConstant;
078        this.surfaceMail = surfaceMail;
079
080
081    }
082
083    public LineItem createLineItemPojo(Class clazz) {
084        LineItem lineItem = null;
085        try {
086            lineItem = (LineItem) clazz.newInstance();
087        } catch (InstantiationException e) {
088            throw new RuntimeException("LineItem creation failed. class = " + clazz);
089        } catch (IllegalAccessException e) {
090            throw new RuntimeException("LineItem creation failed. class = " + clazz);
091        }
092        LineItemArticleNumber lineItemArticleNumber = new LineItemArticleNumber();
093        lineItemArticleNumber.setLineItemIsbn(lineItemIsbn);
094        lineItemArticleNumber.setLineItemNumberType(lineItemNumberType);
095        lineItem.setSequenceNumber(sequenceNumber);
096        lineItem.setItemNumberId(itemNumberId);
097        lineItem.addArticleNumber(lineItemArticleNumber);
098        return lineItem;
099    }
100
101    public ProductFunction createProductFunctionPojo(Class clazz) {
102        ProductFunction productFunction = null;
103        try {
104            productFunction = (ProductFunction) clazz.newInstance();
105        } catch (InstantiationException e) {
106            throw new RuntimeException("Product Function creation failed. class = " + clazz);
107        } catch (IllegalAccessException e) {
108            throw new RuntimeException("Product Function creation failed. class = " + clazz);
109        }
110        ProductArticleNumber productArticleNumber = new ProductArticleNumber();
111        productArticleNumber.setProductIsbn(productIsbn);
112        productArticleNumber.setProductItemNumberType(productItemNumberType);
113        productFunction.setProductId(productId);
114        productFunction.addProductArticleNumber(productArticleNumber);
115
116        return productFunction;
117    }
118
119    public ItemDescription createItemDescriptionPojo(Class clazz) {
120        ItemDescription itemDescription = null;
121        try {
122            itemDescription = (ItemDescription) clazz.newInstance();
123        } catch (InstantiationException e) {
124            throw new RuntimeException("ItemDescription creation failed. class = " + clazz);
125        } catch (IllegalAccessException e) {
126            throw new RuntimeException("ItemDescription creation failed. class = " + clazz);
127        }
128
129        itemDescription.setText(text);
130        itemDescription.setItemCharacteristicCode(itemCharacteristicCode);
131        itemDescription.setData(data);
132        return itemDescription;
133    }
134
135    public QuantityInformation createQuantityInformationPojo(Class clazz) {
136        QuantityInformation quantityInformation = null;
137        try {
138            quantityInformation = (QuantityInformation) clazz.newInstance();
139        } catch (InstantiationException e) {
140            throw new RuntimeException("QuantityInformation creation failed. class = " + clazz);
141        } catch (IllegalAccessException e) {
142            throw new RuntimeException("QuantityInformation creation failed. class = " + clazz);
143        }
144        Qunatity quantity1 = new Qunatity();
145        quantity1.setQuantityConstant(quantityConstant);
146        quantity1.setQuantity(quantity);
147        quantityInformation.addQuantity(quantity1);
148
149        return quantityInformation;
150    }
151
152    public PriceInformation createPriceInformationPojo(Class clazz) {
153        PriceInformation priceInformation = null;
154        try {
155            priceInformation = (PriceInformation) clazz.newInstance();
156        } catch (InstantiationException e) {
157            throw new RuntimeException("PriceInformation creation failed. class = " + clazz);
158        } catch (IllegalAccessException e) {
159            throw new RuntimeException("PriceInformation creation failed. class = " + clazz);
160        }
161        ItemPrice itemPrice = new ItemPrice();
162        itemPrice.setGrossPrice(grossPrice);
163        itemPrice.setPrice(price);
164        priceInformation.addPrice(itemPrice);
165
166        return priceInformation;
167    }
168
169    public BuyerReferenceInformation createBuyerReferenceInformationPojo(Class clazz) {
170        BuyerReferenceInformation buyerReferenceInformation = null;
171        try {
172            buyerReferenceInformation = (BuyerReferenceInformation) clazz.newInstance();
173        } catch (InstantiationException e) {
174            throw new RuntimeException("BuyerReferenceInformation creation failed. class = " + clazz);
175        } catch (IllegalAccessException e) {
176            throw new RuntimeException("BuyerReferenceInformation creation failed. class = " + clazz);
177        }
178        BuyerLineItemReference buyerLineItemReference = new BuyerLineItemReference();
179        buyerLineItemReference.setBuyersOrderLine(buyersOrderLine);
180        buyerLineItemReference.setOrderLineNumber(orderLineNumber);
181        buyerReferenceInformation.addBuyerLineItemReference(buyerLineItemReference);
182
183        return buyerReferenceInformation;
184    }
185
186    public SupplierReferenceInformation createSupplierReferenceInformationPojo(Class clazz) {
187        SupplierReferenceInformation supplierReferenceInformation = null;
188        try {
189            supplierReferenceInformation = (SupplierReferenceInformation) clazz.newInstance();
190        } catch (InstantiationException e) {
191            throw new RuntimeException("SupplierReferenceInformation creation failed. class = " + clazz);
192        } catch (IllegalAccessException e) {
193            throw new RuntimeException("SupplierReferenceInformation creation failed. class = " + clazz);
194        }
195        SupplierLineItemReference supplierLineItemReference = new SupplierLineItemReference();
196        supplierLineItemReference.setSuppliersOrderLine(suppliersOrderLine);
197        supplierLineItemReference.setVendorReferenceNumber(vendorReferenceNumber);
198        supplierReferenceInformation.addSupplierLineItemReference(supplierLineItemReference);
199
200        return supplierReferenceInformation;
201    }
202
203    public FundNumberReference createFundNumberReferencePojo(Class clazz) {
204        FundNumberReference fundNumberReference = null;
205        try {
206            fundNumberReference = (FundNumberReference) clazz.newInstance();
207        } catch (InstantiationException e) {
208            throw new RuntimeException("FundNumberReference creation failed. class = " + clazz);
209        } catch (IllegalAccessException e) {
210            throw new RuntimeException("FundNumberReference creation failed. class = " + clazz);
211        }
212        BuyersFundNumberReference buyersFundNumberReference = new BuyersFundNumberReference();
213        buyersFundNumberReference.setBudgetNumber(budgetNumber);
214        buyersFundNumberReference.setBuyersFundNumber(buyersFundNumber);
215        fundNumberReference.addBuyersFundNumberReference(buyersFundNumberReference);
216
217        return fundNumberReference;
218    }
219
220
221    public TransportStageQualifier createTransportStageQualifierPojo(Class clazz) {
222        TransportStageQualifier transportStageQualifier = null;
223        try {
224            transportStageQualifier = (TransportStageQualifier) clazz.newInstance();
225        } catch (InstantiationException e) {
226            throw new RuntimeException("TransportStageQualifier creation failed. class = " + clazz);
227        } catch (IllegalAccessException e) {
228            throw new RuntimeException("TransportStageQualifier creation failed. class = " + clazz);
229        }
230
231        transportStageQualifier.setSurfaceMail(surfaceMail);
232        transportStageQualifier.setTransportStageConstant(transportStageConstant);
233
234        return transportStageQualifier;
235    }
236}