View Javadoc

1   package org.kuali.ole;
2   
3   /**
4    * Created by IntelliJ IDEA.
5    * User: palanivel
6    * Date: 3/8/12
7    * Time: 7:31 PM
8    * To change this template use File | Settings | File Templates.
9    */
10  import org.kuali.ole.pojo.edi.CurrencyDetailsSupplierInformation;
11  
12  public enum CurrencyDetailsSupplierInformationFixture {
13      CurrencyDetailsSupplierInformation("2",
14                               "USD",
15                               "9"
16      ),;
17  
18      private String defaultCurrency;
19      private String currencyType;
20      private String orderCurrency;
21  
22      private CurrencyDetailsSupplierInformationFixture(String defaultCurrency,String currencyType,
23                                                        String orderCurrency){
24          this.defaultCurrency = defaultCurrency;
25          this.currencyType = currencyType;
26          this.orderCurrency = orderCurrency;
27      }
28  
29      public CurrencyDetailsSupplierInformation createCurrencyDetailsSupplierInformation(Class clazz){
30          CurrencyDetailsSupplierInformation currencyDetailsSupplierInformation = null;
31          try{
32              currencyDetailsSupplierInformation = (CurrencyDetailsSupplierInformation)clazz.newInstance();
33          }catch (InstantiationException e){
34              throw new RuntimeException("CurrencyDetailsSupplierInformation creation failed. class = " + clazz);
35          } catch (IllegalAccessException e) {
36              throw new RuntimeException("CurrencyDetailsSupplierInformation creation failed. class = " + clazz);
37          }
38          currencyDetailsSupplierInformation.setDefaultCurrency(defaultCurrency);
39          currencyDetailsSupplierInformation.setCurrencyType(currencyType);
40          currencyDetailsSupplierInformation.setOrderCurrency(orderCurrency);
41          return currencyDetailsSupplierInformation;
42      }
43  
44  }