public SalesOrderLine(SalesOrder salesOrder, CatalogItem catalogItem, int itemQuantity) { this.catalogItemUid = catalogItem.getCatalogItemUid(); this.salesOrder = salesOrder; this.catalogItem = catalogItem; this.itemQuantity = itemQuantity; this.itemPrice = catalogItem.getItemPrice(); this.extendedPrice = this.itemPrice.multiply(new BigDecimal(this.itemQuantity)); }
public String catalogServiceEndpoint() { String itemId = FacesContext.getCurrentInstance() .getExternalContext() .getRequestParameterMap() .get("itemId"); String response = services.getCatalogService().path(itemId).request().get(String.class); JsonObject jsonObject = Json.createReader(new StringReader(response)).readObject(); catalogItem.setId(jsonObject.getInt("id")); catalogItem.setName(jsonObject.getString("name")); catalogItem.setDescription(jsonObject.getString("description")); return response; }
@Override public int compareTo(CatalogItem another) { return getTitleLower().compareTo(another.getTitleLower()); }