public static final class ShoppingCartItem.Builder extends Object
Builder
creates instances of ShippingCartItem
from values set by the builder's methods.Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
ShoppingCartItem |
build() |
ShoppingCartItem.Builder |
category(String category) |
ShoppingCartItem.Builder |
itemId(String id) |
ShoppingCartItem.Builder |
price(BigDecimal price) |
ShoppingCartItem.Builder |
price(Double price) |
ShoppingCartItem.Builder |
quantity(int quantity) |
public ShoppingCartItem.Builder category(String category)
category
- The category of the item.public ShoppingCartItem.Builder itemId(String id)
id
- Your internal ID for the itempublic ShoppingCartItem.Builder quantity(int quantity)
quantity
- The quantity of the item in the shopping cart.IllegalArgumentException
- when quantity is not positive.public ShoppingCartItem.Builder price(BigDecimal price)
price
- The per-unit price of the item in the shopping cart. This
should use the same currency as the order currency.public ShoppingCartItem.Builder price(Double price)
price
- The price of the item in the shopping cart. This
should be the same currency as the order currency.public ShoppingCartItem build()
ShoppingCartItem
created from the
fields set on this builder.Copyright © 2016 MaxMind, Inc.. All rights reserved.