public Builder toBuilder() { return builder().fromProductItemPrice(this); }
public Builder fromProductItemPrice(ProductItemPrice in) { return this .id(in.getId()) .hourlyRecurringFee(in.getHourlyRecurringFee()) .recurringFee(in.getRecurringFee()) .item(in.getItem()); } }
public ProductItemPrice build() { return new ProductItemPrice(id, itemId, recurringFee, hourlyRecurringFee, item, categories); }
public T fromProductItemPrice(ProductItemPrice in) { return this .id(in.getId()) .itemId(in.getItemId()) .recurringFee(in.getRecurringFee()) .hourlyRecurringFee(in.getHourlyRecurringFee()) .item(in.getItem()) .categories(in.getCategories()); } }
private void checkPrice(ProductItemPrice price) { assert price.getId() > 0 : price; assert price.getItemId() > 0 : price; assert price.getRecurringFee() != null || price.getHourlyRecurringFee() != null : price; }
@Override public Price apply(ProductItemPrice productItemPrice) { return new Price(productItemPrice.getId()); } });
@Override public ProductItem apply(ProductItemPrice productItemPrice) { Set<ProductItemCategory> categories = productItemPrice.getCategories(); ProductItem item = productItemPrice.getItem(); ProductItem.Builder builder = productItemPrice.getItem().toBuilder(); if (item.getCategories().size() == 0 && categories.size() != 0) { builder.categories(categories); } return builder.build(); } };
public T fromProductItemPrice(ProductItemPrice in) { return this .id(in.getId()) .itemId(in.getItemId()) .recurringFee(in.getRecurringFee()) .hourlyRecurringFee(in.getHourlyRecurringFee()) .item(in.getItem()) .categories(in.getCategories()); } }
@Override public String apply(ProductItem productItem) { checkNotNull(productItem, "productItem"); ProductItemPrice price = ProductItems.price().apply(productItem); return "" + price.getId(); } };
@Override public ProductItem apply(ProductItemPrice productItemPrice) { Set<ProductItemCategory> categories = productItemPrice.getCategories(); ProductItem item = productItemPrice.getItem(); ProductItem.Builder builder = productItemPrice.getItem().toBuilder(); if (item.getCategories().size() == 0 && categories.size() != 0) { builder.categories(categories); } return builder.build(); } };
public Builder toBuilder() { return builder().fromProductItemPrice(this); }
public Builder fromProductItemPrice(ProductItemPrice in) { return this .id(in.getId()) .hourlyRecurringFee(in.getHourlyRecurringFee()) .recurringFee(in.getRecurringFee()) .item(in.getItem()); } }
@Override public String apply(List<ProductItem> productItems) { StringBuilder builder = new StringBuilder(); for (ProductItem item : productItems) { ProductItemPrice price = ProductItems.price().apply(item); builder.append(price.getId()).append(","); } return builder.toString().substring(0, builder.lastIndexOf(",")); } };
public ProductItemPrice build() { return new ProductItemPrice(id, hourlyRecurringFee, recurringFee, item); }
public Builder toBuilder() { return builder().fromProductItemPrice(this); }
public Builder fromProductItemPrice(ProductItemPrice in) { return this .id(in.getId()) .hourlyRecurringFee(in.getHourlyRecurringFee()) .recurringFee(in.getRecurringFee()) .item(in.getItem()); } }
@Override public Price apply(ProductItemPrice productItemPrice) { return new Price(productItemPrice.getId()); } });
public ProductItemPrice build() { return new ProductItemPrice(id, hourlyRecurringFee, recurringFee, item); }
@Override public ProductItemPrice apply(String arg0) { return ProductItemPrice.builder().id(Integer.parseInt(arg0)).build(); } });
@Override public String apply(List<ProductItem> productItems) { StringBuilder builder = new StringBuilder(); for (ProductItem item : productItems) { ProductItemPrice price = ProductItems.price().apply(item); builder.append(price.getId()).append(","); } return builder.toString().substring(0, builder.lastIndexOf(",")); } };