Package com.maxmind.minfraud.request
Class ShoppingCartItem.Builder
- java.lang.Object
-
- com.maxmind.minfraud.request.ShoppingCartItem.Builder
-
- Enclosing class:
- ShoppingCartItem
public static final class ShoppingCartItem.Builder extends Object
Builder
creates instances ofShippingCartItem
from values set by the builder's methods.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ShoppingCartItem
build()
ShoppingCartItem.Builder
category(String category)
ShoppingCartItem.Builder
itemId(String id)
ShoppingCartItem.Builder
price(Double price)
ShoppingCartItem.Builder
price(BigDecimal price)
ShoppingCartItem.Builder
quantity(int quantity)
-
-
-
Method Detail
-
category
public ShoppingCartItem.Builder category(String category)
- Parameters:
category
- The category of the item.- Returns:
- The builder object.
-
itemId
public ShoppingCartItem.Builder itemId(String id)
- Parameters:
id
- Your internal ID for the item- Returns:
- The builder object.
-
quantity
public ShoppingCartItem.Builder quantity(int quantity)
- Parameters:
quantity
- The quantity of the item in the shopping cart.- Returns:
- The builder object.
- Throws:
IllegalArgumentException
- when quantity is not positive.
-
price
public ShoppingCartItem.Builder price(BigDecimal price)
- Parameters:
price
- The per-unit price of the item in the shopping cart. This should use the same currency as the order currency.- Returns:
- The builder object.
-
price
public ShoppingCartItem.Builder price(Double price)
- Parameters:
price
- The price of the item in the shopping cart. This should be the same currency as the order currency.- Returns:
- The builder object.
-
build
public ShoppingCartItem build()
- Returns:
- An instance of
ShoppingCartItem
created from the fields set on this builder.
-
-