LineItem.Builder | Android Developers

Quicknav Quicknav
Links

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

Android Sites

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

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Tools & Reference
  - Developer Stories

## Results

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

# LineItem.Builder

extends Object

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

## Class Overview

Builder to create a `LineItem`.

## Summary

Public Methods
LineItem | build()
LineItem.Builder | setCurrencyCode(String currencyCode) Sets the ISO 4217 currency code of the transaction.
LineItem.Builder | setDescription(String description) Sets the description of the line item.
LineItem.Builder | setQuantity(String quantity) Sets the number of items purchased.
LineItem.Builder | setRole(int role) Supply the role only to distinguish tax and shipping from regular items.
LineItem.Builder | setTotalPrice(String totalPrice) Sets the total price for this line item.
LineItem.Builder | setUnitPrice(String unitPrice) Sets the unit price per item.

[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 LineItem build ()

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

Sets the ISO 4217 currency code of the transaction.

#### public LineItem.Builder setDescription (String description)

Sets the description of the line item.

#### public LineItem.Builder setQuantity (String quantity)

Sets the number of items purchased. The format of this string follows the regex: [0-9]+(\.[0-9])?

#### public LineItem.Builder setRole (int role)

Supply the role only to distinguish tax and shipping from regular items. Valid values are defined in `LineItem.Role`. Defaults to `REGULAR`, indicating a regular item. Only one `TAX` entry is permitted.

##### See Also

- `LineItem.Role`

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

Sets the total price for this line item. The format of this string follows the regex: ^-?[0-9]+(\.[0-9][0-9])?

#### public LineItem.Builder setUnitPrice (String unitPrice)

Sets the unit price per item. The format of this string follows the regex: ^-?[0-9]+(\.[0-9][0-9])?