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 of ShippingCartItem from values set by the builder's methods.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • 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.