Exemplo n.º 1
0
  public static List<String> getSupportedTypeList(
      List<ProductType> supportedTypeList, String detectedType) {
    List<String> productList = new ArrayList<>();
    if (detectedType != null) {
      productList.add(detectedType);
    }

    for (ProductType productType : supportedTypeList) {
      if (!productType.getType().equals(detectedType)) {
        productList.add(productType.getType());
      }
    }

    return productList;
  }
Exemplo n.º 2
0
  public static List<ProductType> copyProductTypeList(List<ProductType> productTypeList) {
    List<ProductType> newProductList = new ArrayList<>();
    for (ProductType p : productTypeList) {
      ProductType newP = new ProductType();
      newP.setType(p.getType());
      newP.setBox(p.getBox());
      newP.setScore(p.getScore());

      newProductList.add(p);
    }

    return newProductList;
  }