Class Revenue.Builder

java.lang.Object
com.yandex.metrica.Revenue.Builder
Enclosing class:
Revenue

public static class Revenue.Builder
extends java.lang.Object
Builder class for Revenue objects.
  • Method Details

    • withQuantity

      @NonNull public Revenue.Builder withQuantity​(@Nullable java.lang.Integer quantity)
      Sets the quantity of products purchased.

      It is an optional value.

      Parameters:
      quantity - Quantity of products purchased
      Returns:
      The same Revenue.Builder object
      See Also:
      Revenue.quantity
    • withProductID

      @NonNull public Revenue.Builder withProductID​(@Nullable java.lang.String productID)
      Sets the custom ID of the product purchased.

      It is an optional value.

      Parameters:
      productID - ID of the product
      Returns:
      The Revenue.Builder object
      See Also:
      Revenue.productID
    • withPayload

      @NonNull public Revenue.Builder withPayload​(@Nullable java.lang.String payload)
      Sets additional information about the purchase.
      Parameters:
      payload - Additional info to be passed about the purchase. It should contain the valid JSON string
      Returns:
      The same Revenue.Builder object
      See Also:
      Revenue.payload
    • withReceipt

      @NonNull public Revenue.Builder withReceipt​(@Nullable Revenue.Receipt receipt)
      Sets the receipt information about the purchase.

      Used only for in-app purchases.

      Parameters:
      receipt - Purchase receipt data
      Returns:
      The same Revenue.Builder object
      See Also:
      Revenue.receipt, Revenue.Receipt
    • build

      @NonNull public Revenue build()
      Creates the Revenue instance.
      Returns:
      The Revenue object