@@ -0,0 +1,2642 @@
+package pl.koszela.jan.persistence.converter;%0A%0Aimport com.google.gson.Gson;%0Aimport java.io.FileReader;%0Aimport java.io.IOException;%0Aimport java.io.Reader;%0Aimport java.util.Arrays;%0Aimport java.util.List;%0Aimport pl.koszela.jan.persistence.dto.ProductDTO;%0Aimport pl.koszela.jan.persistence.dto.SpecialPriceDTO;%0Aimport pl.koszela.jan.persistence.dto.impl.DefaultProductDTO;%0Aimport pl.koszela.jan.persistence.dto.impl.DefaultProductListDTO;%0Aimport pl.koszela.jan.persistence.dto.impl.DefaultSpecialPriceDTO;%0A%0A/**%0A * Created on 10.08.2017.%0A *%0A * @author Jan Koszela%0A */%0Apublic class JsonConverter %7B%0A%0A  public static final Gson GSON = new Gson();%0A  private static final String PRODUCT_FILE = %22MOCK_DATA_Products.json%22;%0A  private static final String SPECIAL_PRICES_FILE = %22MOCK_DATA_Special_Prices.json%22;%0A  public static final String RESOURCES_SAMPLE_PATH = %22src%5C%5Cmain%5C%5Cresources%5C%5Csample%5C%5C%22;%0A%0A  private DefaultProductDTO%5B%5D productDTOS;%0A  private DefaultSpecialPriceDTO%5B%5D specialPriceDTOS;%0A%0A  public static void main(String%5B%5D args) %7B%0A%0A    try (Reader reader = new FileReader(RESOURCES_SAMPLE_PATH + PRODUCT_FILE)) %7B%0A%0A      // Convert JSON to Java Object%0A      DefaultProductDTO%5B%5D productDTOS = GSON.fromJson(reader, DefaultProductDTO%5B%5D.class);%0A%0A      for (int i = 0; i %3C productDTOS.length; i++) %7B%0A        System.out.println(productDTOS%5Bi%5D);%0A      %7D%0A%0A      DefaultProductListDTO productList = new DefaultProductListDTO();%0A      productList.setProducts(Arrays.asList(productDTOS));%0A%0A      System.out.println(productList);%0A    %7D catch (IOException e) %7B%0A      e.printStackTrace();%0A    %7D%0A%0A  %7D%0A%0A  public void convert() %7B%0A    convertProducts();%0A    convertSpecialPrices();%0A  %7D%0A%0A  private void convertProducts() %7B%0A    try (Reader reader = new FileReader(RESOURCES_SAMPLE_PATH + PRODUCT_FILE)) %7B%0A%0A      // Convert JSON to Java Object%0A      productDTOS = GSON.fromJson(reader, DefaultProductDTO%5B%5D.class);%0A%0A    %7D catch (IOException e) %7B%0A      e.printStackTrace();%0A    %7D%0A  %7D%0A%0A  private void convertSpecialPrices() %7B%0A    try (Reader reader = new FileReader(RESOURCES_SAMPLE_PATH + SPECIAL_PRICES_FILE)) %7B%0A%0A      // Convert JSON to Java Object%0A      specialPriceDTOS = GSON.fromJson(reader, DefaultSpecialPriceDTO%5B%5D.class);%0A%0A    %7D catch (IOException e) %7B%0A      e.printStackTrace();%0A    %7D%0A  %7D%0A%0A  public ProductDTO%5B%5D getProductArray() %7B%0A    return this.productDTOS;%0A  %7D%0A%0A  public List%3CProductDTO%3E getProductList() %7B%0A    return Arrays.asList(this.productDTOS);%0A  %7D%0A%0A  public SpecialPriceDTO%5B%5D getSpecialPriceArray() %7B%0A    return this.specialPriceDTOS;%0A  %7D%0A%0A  public List%3CSpecialPriceDTO%3E getSpecialPriceList() %7B%0A    return Arrays.asList(this.specialPriceDTOS);%0A  %7D%0A%0A%7D%0A

Add Json converter for test and application workflow