View Javadoc
1   package org.kuali.ole;
2   
3   import org.kuali.ole.pojo.edi.*;
4   
5   import java.util.ArrayList;
6   import java.util.Arrays;
7   import java.util.List;
8   
9   /**
10   * Created by IntelliJ IDEA.
11   * User: palanivel
12   * Date: 3/8/12
13   * Time: 8:31 PM
14   * To change this template use File | Settings | File Templates.
15   */
16  public enum LineItemOrderFixture {
17      LINEITEM("1", null, "9783835309449", "EN", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null),
18      PRODUCTFUNCTION(null, null, null, null, "5", "3835309447", "IB", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null),
19      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),
20      QUANTITYINFORMATION(null, null, null, null, null, null, null, null, null, null, "21", "1", null, null, null, null, null, null, null, null, null, null),
21      PRICEINFORMATION(null, null, null, null, null, null, null, null, null, null, null, null, "AAB", "34.07", null, null, null, null, null, null, null, null),
22      REFERENCEINFORMATION(null, null, null, null, null, null, null, null, null, null, null, null, null, null, "LI", "603634", null, null, null, null, null, null),
23      SUPPLIERSREFERENCEINFORMATION(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "SLI", "har110148705", null, null, null, null),
24      FUNDNUMBERREFERENCE(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "BFN", "PXXUXXXGRXXX631-2012", null, null),
25      TRANSPORTSTAGEQUALIFIER(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "20", "53"),;
26  
27      private String sequenceNumber;
28      private String itemNumberId;
29      private String lineItemIsbn;
30      private String lineItemNumberType;
31      private String productId;
32      private String productIsbn;
33      private String productItemNumberType;
34      private String text;
35      private String itemCharacteristicCode;
36      private String data;
37      private String quantityConstant;
38      private String quantity;
39      private String grossPrice;
40      private String price;
41      private String buyersOrderLine;
42      private String orderLineNumber;
43      private String suppliersOrderLine;
44      private String vendorReferenceNumber;
45      private String buyersFundNumber;
46      private String budgetNumber;
47      private String transportStageConstant;
48      private String surfaceMail;
49  
50      private LineItemOrderFixture(String sequenceNumber, String itemNumberId, String lineItemIsbn,
51                                   String lineItemNumberType, String productId, String productIsbn,
52                                   String productItemNumberType, String text, String itemCharacteristicCode,
53                                   String data, String quantityConstant, String quantity, String grossPrice,
54                                   String price, String buyersOrderLine, String orderLineNumber, String suppliersOrderLine,
55                                   String vendorReferenceNumber, String buyersFundNumber, String budgetNumber, String transportStageConstant,
56                                   String surfaceMail) {
57          this.sequenceNumber = sequenceNumber;
58          this.itemNumberId = itemNumberId;
59          this.lineItemIsbn = lineItemIsbn;
60          this.lineItemNumberType = lineItemNumberType;
61          this.productId = productId;
62          this.productIsbn = productIsbn;
63          this.productItemNumberType = productItemNumberType;
64          this.text = text;
65          this.itemCharacteristicCode = itemCharacteristicCode;
66          this.data = data;
67          this.quantityConstant = quantityConstant;
68          this.quantity = quantity;
69          this.grossPrice = grossPrice;
70          this.price = price;
71          this.buyersOrderLine = buyersOrderLine;
72          this.orderLineNumber = orderLineNumber;
73          this.suppliersOrderLine = suppliersOrderLine;
74          this.vendorReferenceNumber = vendorReferenceNumber;
75          this.buyersFundNumber = buyersFundNumber;
76          this.budgetNumber = budgetNumber;
77          this.transportStageConstant = transportStageConstant;
78          this.surfaceMail = surfaceMail;
79  
80  
81      }
82  
83      public LineItem createLineItemPojo(Class clazz) {
84          LineItem lineItem = null;
85          try {
86              lineItem = (LineItem) clazz.newInstance();
87          } catch (InstantiationException e) {
88              throw new RuntimeException("LineItem creation failed. class = " + clazz);
89          } catch (IllegalAccessException e) {
90              throw new RuntimeException("LineItem creation failed. class = " + clazz);
91          }
92          LineItemArticleNumber lineItemArticleNumber = new LineItemArticleNumber();
93          lineItemArticleNumber.setLineItemIsbn(lineItemIsbn);
94          lineItemArticleNumber.setLineItemNumberType(lineItemNumberType);
95          lineItem.setSequenceNumber(sequenceNumber);
96          lineItem.setItemNumberId(itemNumberId);
97          lineItem.addArticleNumber(lineItemArticleNumber);
98          return lineItem;
99      }
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 }