ShoppingCart.Builder


public final class ShoppingCart.Builder


Builder class for ShoppingCart.

Summary

Public constructors

Public methods

ShoppingCart.Builder

Adds the display time window for the shopping cart.

ShoppingCart.Builder

Adds the display time window for the shopping cart.

ShoppingCart.Builder

Add a item label in the shopping cart cluster

ShoppingCart.Builder

Add a list of item labels in the shopping cart cluster

ShoppingCart.Builder

Adds a poster image of the items in the shopping cart.

ShoppingCart.Builder

Adds poster images of the items in the shopping cart.

ShoppingCart
ShoppingCart.Builder

Sets the action link uri for the shopping cart.

ShoppingCart.Builder

Sets the action text of the shopping cart. e.g. "View Cart"

ShoppingCart.Builder
@CanIgnoreReturnValue
setLastUserInteractionTimestampMillis(
    long lastUserInteractionTimestampMillis
)

Sets the timestamp when the user last interacted with the shopping cart.

ShoppingCart.Builder

Sets the number of items in the shopping cart.

ShoppingCart.Builder

Sets the title of the shopping cart.

Public constructors

Builder

public Builder()

Public methods

addAllDisplayTimeWindow

@CanIgnoreReturnValue
public ShoppingCart.Builder addAllDisplayTimeWindow(List<DisplayTimeWindow> displayTimeWindows)

Adds the display time window for the shopping cart.

Optional.

addDisplayTimeWindow

@CanIgnoreReturnValue
public ShoppingCart.Builder addDisplayTimeWindow(DisplayTimeWindow displayTimeWindow)

Adds the display time window for the shopping cart.

Optional.

addItemLabel

@CanIgnoreReturnValue
public ShoppingCart.Builder addItemLabel(String itemLabel)

Add a item label in the shopping cart cluster

Optional.

addItemLabels

@CanIgnoreReturnValue
public ShoppingCart.Builder addItemLabels(List<String> itemLabels)

Add a list of item labels in the shopping cart cluster

Optional.

addPosterImage

@CanIgnoreReturnValue
public ShoppingCart.Builder addPosterImage(Image image)

Adds a poster image of the items in the shopping cart.

Optional.

addPosterImages

@CanIgnoreReturnValue
public ShoppingCart.Builder addPosterImages(List<Image> images)

Adds poster images of the items in the shopping cart.

Optional.

build

public ShoppingCart build()

setActionLinkUri

@CanIgnoreReturnValue
public ShoppingCart.Builder setActionLinkUri(Uri actionLinkUri)

Sets the action link uri for the shopping cart.

Required.

setActionText

@CanIgnoreReturnValue
public ShoppingCart.Builder setActionText(String actionText)

Sets the action text of the shopping cart. e.g. "View Cart"

Optional.

setLastUserInteractionTimestampMillis

@CanIgnoreReturnValue
public ShoppingCart.Builder setLastUserInteractionTimestampMillis(
    long lastUserInteractionTimestampMillis
)

Sets the timestamp when the user last interacted with the shopping cart.

Required for partner apps publishing multiple carts per user. Optional, if publishing a single cart.

setNumberOfItems

@CanIgnoreReturnValue
public ShoppingCart.Builder setNumberOfItems(int numberOfItems)

Sets the number of items in the shopping cart.

When set to 0, the cart is empty.

Optional.

setTitle

@CanIgnoreReturnValue
public ShoppingCart.Builder setTitle(String title)

Sets the title of the shopping cart.

Optional.