Class TransactionInfo.Builder (0.35.0)

public static final class TransactionInfo.Builder extends GeneratedMessageV3.Builder<TransactionInfo.Builder> implements TransactionInfoOrBuilder

A transaction represents the entire purchase transaction.

Protobuf type google.cloud.discoveryengine.v1alpha.TransactionInfo

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public TransactionInfo.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
TransactionInfo.Builder
Overrides

build()

public TransactionInfo build()
Returns
TypeDescription
TransactionInfo

buildPartial()

public TransactionInfo buildPartial()
Returns
TypeDescription
TransactionInfo

clear()

public TransactionInfo.Builder clear()
Returns
TypeDescription
TransactionInfo.Builder
Overrides

clearCost()

public TransactionInfo.Builder clearCost()

All the costs associated with the products. These can be manufacturing costs, shipping expenses not borne by the end user, or any other costs, such that:

  • Profit = value - tax - cost

optional float cost = 5;

Returns
TypeDescription
TransactionInfo.Builder

This builder for chaining.

clearCurrency()

public TransactionInfo.Builder clearCurrency()

Required. Currency code. Use three-character ISO-4217 code.

string currency = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
TransactionInfo.Builder

This builder for chaining.

clearDiscountValue()

public TransactionInfo.Builder clearDiscountValue()

The total discount(s) value applied to this transaction. This figure should be excluded from TransactionInfo.value

For example, if a user paid TransactionInfo.value amount, then nominal (pre-discount) value of the transaction is the sum of TransactionInfo.value and TransactionInfo.discount_value

This means that profit is calculated the same way, regardless of the discount value, and that TransactionInfo.discount_value can be larger than TransactionInfo.value:

  • Profit = value - tax - cost

optional float discount_value = 6;

Returns
TypeDescription
TransactionInfo.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public TransactionInfo.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
TransactionInfo.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public TransactionInfo.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
TransactionInfo.Builder
Overrides

clearTax()

public TransactionInfo.Builder clearTax()

All the taxes associated with the transaction.

optional float tax = 4;

Returns
TypeDescription
TransactionInfo.Builder

This builder for chaining.

clearTransactionId()

public TransactionInfo.Builder clearTransactionId()

The transaction ID with a length limit of 128 characters.

string transaction_id = 3;

Returns
TypeDescription
TransactionInfo.Builder

This builder for chaining.

clearValue()

public TransactionInfo.Builder clearValue()

Required. Total non-zero value associated with the transaction. This value may include shipping, tax, or other adjustments to the total value that you want to include.

optional float value = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
TransactionInfo.Builder

This builder for chaining.

clone()

public TransactionInfo.Builder clone()
Returns
TypeDescription
TransactionInfo.Builder
Overrides

getCost()

public float getCost()

All the costs associated with the products. These can be manufacturing costs, shipping expenses not borne by the end user, or any other costs, such that:

  • Profit = value - tax - cost

optional float cost = 5;

Returns
TypeDescription
float

The cost.

getCurrency()

public String getCurrency()

Required. Currency code. Use three-character ISO-4217 code.

string currency = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
String

The currency.

getCurrencyBytes()

public ByteString getCurrencyBytes()

Required. Currency code. Use three-character ISO-4217 code.

string currency = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
ByteString

The bytes for currency.

getDefaultInstanceForType()

public TransactionInfo getDefaultInstanceForType()
Returns
TypeDescription
TransactionInfo

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getDiscountValue()

public float getDiscountValue()

The total discount(s) value applied to this transaction. This figure should be excluded from TransactionInfo.value

For example, if a user paid TransactionInfo.value amount, then nominal (pre-discount) value of the transaction is the sum of TransactionInfo.value and TransactionInfo.discount_value

This means that profit is calculated the same way, regardless of the discount value, and that TransactionInfo.discount_value can be larger than TransactionInfo.value:

  • Profit = value - tax - cost

optional float discount_value = 6;

Returns
TypeDescription
float

The discountValue.

getTax()

public float getTax()

All the taxes associated with the transaction.

optional float tax = 4;

Returns
TypeDescription
float

The tax.

getTransactionId()

public String getTransactionId()

The transaction ID with a length limit of 128 characters.

string transaction_id = 3;

Returns
TypeDescription
String

The transactionId.

getTransactionIdBytes()

public ByteString getTransactionIdBytes()

The transaction ID with a length limit of 128 characters.

string transaction_id = 3;

Returns
TypeDescription
ByteString

The bytes for transactionId.

getValue()

public float getValue()

Required. Total non-zero value associated with the transaction. This value may include shipping, tax, or other adjustments to the total value that you want to include.

optional float value = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
float

The value.

hasCost()

public boolean hasCost()

All the costs associated with the products. These can be manufacturing costs, shipping expenses not borne by the end user, or any other costs, such that:

  • Profit = value - tax - cost

optional float cost = 5;

Returns
TypeDescription
boolean

Whether the cost field is set.

hasDiscountValue()

public boolean hasDiscountValue()

The total discount(s) value applied to this transaction. This figure should be excluded from TransactionInfo.value

For example, if a user paid TransactionInfo.value amount, then nominal (pre-discount) value of the transaction is the sum of TransactionInfo.value and TransactionInfo.discount_value

This means that profit is calculated the same way, regardless of the discount value, and that TransactionInfo.discount_value can be larger than TransactionInfo.value:

  • Profit = value - tax - cost

optional float discount_value = 6;

Returns
TypeDescription
boolean

Whether the discountValue field is set.

hasTax()

public boolean hasTax()

All the taxes associated with the transaction.

optional float tax = 4;

Returns
TypeDescription
boolean

Whether the tax field is set.

hasValue()

public boolean hasValue()

Required. Total non-zero value associated with the transaction. This value may include shipping, tax, or other adjustments to the total value that you want to include.

optional float value = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
boolean

Whether the value field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(TransactionInfo other)

public TransactionInfo.Builder mergeFrom(TransactionInfo other)
Parameter
NameDescription
otherTransactionInfo
Returns
TypeDescription
TransactionInfo.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public TransactionInfo.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
TransactionInfo.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public TransactionInfo.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
TransactionInfo.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final TransactionInfo.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
TransactionInfo.Builder
Overrides

setCost(float value)

public TransactionInfo.Builder setCost(float value)

All the costs associated with the products. These can be manufacturing costs, shipping expenses not borne by the end user, or any other costs, such that:

  • Profit = value - tax - cost

optional float cost = 5;

Parameter
NameDescription
valuefloat

The cost to set.

Returns
TypeDescription
TransactionInfo.Builder

This builder for chaining.

setCurrency(String value)

public TransactionInfo.Builder setCurrency(String value)

Required. Currency code. Use three-character ISO-4217 code.

string currency = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueString

The currency to set.

Returns
TypeDescription
TransactionInfo.Builder

This builder for chaining.

setCurrencyBytes(ByteString value)

public TransactionInfo.Builder setCurrencyBytes(ByteString value)

Required. Currency code. Use three-character ISO-4217 code.

string currency = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueByteString

The bytes for currency to set.

Returns
TypeDescription
TransactionInfo.Builder

This builder for chaining.

setDiscountValue(float value)

public TransactionInfo.Builder setDiscountValue(float value)

The total discount(s) value applied to this transaction. This figure should be excluded from TransactionInfo.value

For example, if a user paid TransactionInfo.value amount, then nominal (pre-discount) value of the transaction is the sum of TransactionInfo.value and TransactionInfo.discount_value

This means that profit is calculated the same way, regardless of the discount value, and that TransactionInfo.discount_value can be larger than TransactionInfo.value:

  • Profit = value - tax - cost

optional float discount_value = 6;

Parameter
NameDescription
valuefloat

The discountValue to set.

Returns
TypeDescription
TransactionInfo.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public TransactionInfo.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
TransactionInfo.Builder
Overrides

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public TransactionInfo.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
TransactionInfo.Builder
Overrides

setTax(float value)

public TransactionInfo.Builder setTax(float value)

All the taxes associated with the transaction.

optional float tax = 4;

Parameter
NameDescription
valuefloat

The tax to set.

Returns
TypeDescription
TransactionInfo.Builder

This builder for chaining.

setTransactionId(String value)

public TransactionInfo.Builder setTransactionId(String value)

The transaction ID with a length limit of 128 characters.

string transaction_id = 3;

Parameter
NameDescription
valueString

The transactionId to set.

Returns
TypeDescription
TransactionInfo.Builder

This builder for chaining.

setTransactionIdBytes(ByteString value)

public TransactionInfo.Builder setTransactionIdBytes(ByteString value)

The transaction ID with a length limit of 128 characters.

string transaction_id = 3;

Parameter
NameDescription
valueByteString

The bytes for transactionId to set.

Returns
TypeDescription
TransactionInfo.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final TransactionInfo.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
TransactionInfo.Builder
Overrides

setValue(float value)

public TransactionInfo.Builder setValue(float value)

Required. Total non-zero value associated with the transaction. This value may include shipping, tax, or other adjustments to the total value that you want to include.

optional float value = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valuefloat

The value to set.

Returns
TypeDescription
TransactionInfo.Builder

This builder for chaining.