public class EcommerceItem extends Object implements javax.json.JsonValue
| Constructor and Description |
|---|
EcommerceItem(String sku,
String name,
String category,
Double price,
Integer quantity)
Construct an EcommerceItem from its sku, name, category, price, and
quantity of the order.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getCategory()
Get an item's category.
|
String |
getName()
Get an item's name.
|
Double |
getPrice()
Get an item's price.
|
Integer |
getQuantity()
Get the quantity of this item in this order.
|
String |
getSku()
Get an item's sku.
|
javax.json.JsonValue.ValueType |
getValueType()
Get the JSON value type of EcommerceItem.
|
void |
setCategory(String category)
Set an item's category.
|
void |
setName(String name)
Set an item's name.
|
void |
setPrice(Double price)
Set an item's price.
|
void |
setQuantity(Integer quantity)
Set the quantity of this item in this order
|
void |
setSku(String sku)
Set an item's sku.
|
String |
toString()
Returns the value of this EcommerceItem as a JSON Array string.
|
public EcommerceItem(String sku, String name, String category, Double price, Integer quantity)
sku - the item's skuname - the item's namecategory - the item's categoryprice - the item's pricequantity - the quantity of this item in this orderpublic String getSku()
public void setSku(String sku)
sku - the sku to setpublic String getName()
public void setName(String name)
name - the name to setpublic String getCategory()
public void setCategory(String category)
category - the category to setpublic Double getPrice()
public void setPrice(Double price)
price - the price to setpublic Integer getQuantity()
public void setQuantity(Integer quantity)
quantity - the quantity of this item to setpublic javax.json.JsonValue.ValueType getValueType()
getValueType in interface javax.json.JsonValueCopyright © 2016. All rights reserved.