Example #1
0
 public GroceryListBean createGroceryListBean(GroceryListDto groceryListDto) {
   GroceryListBean groceryListBean = new GroceryListBean(groceryListDto.getName());
   for (ProductDto productDto : groceryListDto.getItems()) {
     ProductBean productBean = createProductBean(productDto);
     productBean.setId(productDto.getId());
     productBean.setQuantity(productDto.getQuantity());
     productBean.setCost(productDto.getCost());
     groceryListBean.getItems().add(productBean);
   }
   return groceryListBean;
 }
Example #2
0
 public ProductBean createProductBean(ProductDto productDto) {
   ProductBean productBean = new ProductBean();
   productBean.setMeasuredIn(productDto.getMeasuredIn());
   productBean.setName(productDto.getName());
   return productBean;
 }