Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

close

- - Get Started
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
    - Get the SDK
  - Google Services
- - Google Play
  - Publishing
  - Promoting
  - App Quality
  - Spotlight
  - Open Distribution

## Results

Loading...
Summary: Methods | Inherited Methods | [Expand All]
public final class

# Cart.Builder

extends Object

java.lang.Object
↳ | com.google.android.gms.wallet.Cart.Builder

## Class Overview

Builder to create a `Cart`.

## Summary

Public Methods
Cart.Builder | addLineItem(LineItem lineItem) Adds a line item to the shopping cart.
Cart | build()
Cart.Builder | setCurrencyCode(String currencyCode) Required field.
Cart.Builder | setLineItems(List<LineItem> lineItems) Sets the line items in the shopping cart.
Cart.Builder | setTotalPrice(String totalPrice) Required field.

[Expand] Inherited Methods

From class java.lang.Object

Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)

## Public Methods

#### public Cart.Builder addLineItem (LineItem lineItem)

Adds a line item to the shopping cart.

#### public Cart build ()

#### public Cart.Builder setCurrencyCode (String currencyCode)

Required field. Sets the ISO 4217 currency code of the transaction.

#### public Cart.Builder setLineItems (List<LineItem> lineItems)

Sets the line items in the shopping cart. Removes any previous line items associated with this cart.

#### public Cart.Builder setTotalPrice (String totalPrice)

Required field. Sets the total price of the cart. The format of this string follows the regex: [0-9]+(\.[0-9][0-9])?