Class TransactionInfo.Builder

  • All Implemented Interfaces:
    TransactionInfoOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    TransactionInfo

    public static final class TransactionInfo.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<TransactionInfo.Builder>
    implements TransactionInfoOrBuilder
     A transaction represents the entire purchase transaction.
     
    Protobuf type google.cloud.discoveryengine.v1beta.TransactionInfo
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<TransactionInfo.Builder>
      • clear

        public TransactionInfo.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<TransactionInfo.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<TransactionInfo.Builder>
      • getDefaultInstanceForType

        public TransactionInfo getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public TransactionInfo build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public TransactionInfo buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public TransactionInfo.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<TransactionInfo.Builder>
      • setField

        public TransactionInfo.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<TransactionInfo.Builder>
      • clearField

        public TransactionInfo.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<TransactionInfo.Builder>
      • clearOneof

        public TransactionInfo.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<TransactionInfo.Builder>
      • setRepeatedField

        public TransactionInfo.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                        int index,
                                                        Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<TransactionInfo.Builder>
      • addRepeatedField

        public TransactionInfo.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                        Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<TransactionInfo.Builder>
      • mergeFrom

        public TransactionInfo.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<TransactionInfo.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<TransactionInfo.Builder>
      • mergeFrom

        public TransactionInfo.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                          throws IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<TransactionInfo.Builder>
        Throws:
        IOException
      • 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];
        Specified by:
        hasValue in interface TransactionInfoOrBuilder
        Returns:
        Whether the value field is set.
      • 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];
        Specified by:
        getValue in interface TransactionInfoOrBuilder
        Returns:
        The value.
      • setValue

        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];
        Parameters:
        value - The value to set.
        Returns:
        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:
        This builder for chaining.
      • getCurrency

        public String getCurrency()
         Required. Currency code. Use three-character ISO-4217 code.
         
        string currency = 2 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getCurrency in interface TransactionInfoOrBuilder
        Returns:
        The currency.
      • getCurrencyBytes

        public com.google.protobuf.ByteString getCurrencyBytes()
         Required. Currency code. Use three-character ISO-4217 code.
         
        string currency = 2 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getCurrencyBytes in interface TransactionInfoOrBuilder
        Returns:
        The bytes for currency.
      • setCurrency

        public TransactionInfo.Builder setCurrency​(String value)
         Required. Currency code. Use three-character ISO-4217 code.
         
        string currency = 2 [(.google.api.field_behavior) = REQUIRED];
        Parameters:
        value - The currency to set.
        Returns:
        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:
        This builder for chaining.
      • setCurrencyBytes

        public TransactionInfo.Builder setCurrencyBytes​(com.google.protobuf.ByteString value)
         Required. Currency code. Use three-character ISO-4217 code.
         
        string currency = 2 [(.google.api.field_behavior) = REQUIRED];
        Parameters:
        value - The bytes for currency to set.
        Returns:
        This builder for chaining.
      • getTransactionId

        public String getTransactionId()
         The transaction ID with a length limit of 128 characters.
         
        string transaction_id = 3;
        Specified by:
        getTransactionId in interface TransactionInfoOrBuilder
        Returns:
        The transactionId.
      • getTransactionIdBytes

        public com.google.protobuf.ByteString getTransactionIdBytes()
         The transaction ID with a length limit of 128 characters.
         
        string transaction_id = 3;
        Specified by:
        getTransactionIdBytes in interface TransactionInfoOrBuilder
        Returns:
        The bytes for transactionId.
      • setTransactionId

        public TransactionInfo.Builder setTransactionId​(String value)
         The transaction ID with a length limit of 128 characters.
         
        string transaction_id = 3;
        Parameters:
        value - The transactionId to set.
        Returns:
        This builder for chaining.
      • clearTransactionId

        public TransactionInfo.Builder clearTransactionId()
         The transaction ID with a length limit of 128 characters.
         
        string transaction_id = 3;
        Returns:
        This builder for chaining.
      • setTransactionIdBytes

        public TransactionInfo.Builder setTransactionIdBytes​(com.google.protobuf.ByteString value)
         The transaction ID with a length limit of 128 characters.
         
        string transaction_id = 3;
        Parameters:
        value - The bytes for transactionId to set.
        Returns:
        This builder for chaining.
      • hasTax

        public boolean hasTax()
         All the taxes associated with the transaction.
         
        optional float tax = 4;
        Specified by:
        hasTax in interface TransactionInfoOrBuilder
        Returns:
        Whether the tax field is set.
      • getTax

        public float getTax()
         All the taxes associated with the transaction.
         
        optional float tax = 4;
        Specified by:
        getTax in interface TransactionInfoOrBuilder
        Returns:
        The tax.
      • setTax

        public TransactionInfo.Builder setTax​(float value)
         All the taxes associated with the transaction.
         
        optional float tax = 4;
        Parameters:
        value - The tax to set.
        Returns:
        This builder for chaining.
      • clearTax

        public TransactionInfo.Builder clearTax()
         All the taxes associated with the transaction.
         
        optional float tax = 4;
        Returns:
        This builder for chaining.
      • 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][google.cloud.discoveryengine.v1beta.TransactionInfo.value] -
         [tax][google.cloud.discoveryengine.v1beta.TransactionInfo.tax] -
         [cost][google.cloud.discoveryengine.v1beta.TransactionInfo.cost]
         
        optional float cost = 5;
        Specified by:
        hasCost in interface TransactionInfoOrBuilder
        Returns:
        Whether the cost field is set.
      • 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][google.cloud.discoveryengine.v1beta.TransactionInfo.value] -
         [tax][google.cloud.discoveryengine.v1beta.TransactionInfo.tax] -
         [cost][google.cloud.discoveryengine.v1beta.TransactionInfo.cost]
         
        optional float cost = 5;
        Specified by:
        getCost in interface TransactionInfoOrBuilder
        Returns:
        The cost.
      • setCost

        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][google.cloud.discoveryengine.v1beta.TransactionInfo.value] -
         [tax][google.cloud.discoveryengine.v1beta.TransactionInfo.tax] -
         [cost][google.cloud.discoveryengine.v1beta.TransactionInfo.cost]
         
        optional float cost = 5;
        Parameters:
        value - The cost to set.
        Returns:
        This builder for chaining.
      • 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][google.cloud.discoveryengine.v1beta.TransactionInfo.value] -
         [tax][google.cloud.discoveryengine.v1beta.TransactionInfo.tax] -
         [cost][google.cloud.discoveryengine.v1beta.TransactionInfo.cost]
         
        optional float cost = 5;
        Returns:
        This builder for chaining.
      • hasDiscountValue

        public boolean hasDiscountValue()
         The total discount(s) value applied to this transaction.
         This figure should be excluded from
         [TransactionInfo.value][google.cloud.discoveryengine.v1beta.TransactionInfo.value]
        
         For example, if a user paid
         [TransactionInfo.value][google.cloud.discoveryengine.v1beta.TransactionInfo.value]
         amount, then nominal (pre-discount) value of the transaction is the sum of
         [TransactionInfo.value][google.cloud.discoveryengine.v1beta.TransactionInfo.value]
         and
         [TransactionInfo.discount_value][google.cloud.discoveryengine.v1beta.TransactionInfo.discount_value]
        
         This means that profit is calculated the same way, regardless of the
         discount value, and that
         [TransactionInfo.discount_value][google.cloud.discoveryengine.v1beta.TransactionInfo.discount_value]
         can be larger than
         [TransactionInfo.value][google.cloud.discoveryengine.v1beta.TransactionInfo.value]:
        
         * Profit =
         [value][google.cloud.discoveryengine.v1beta.TransactionInfo.value] -
         [tax][google.cloud.discoveryengine.v1beta.TransactionInfo.tax] -
         [cost][google.cloud.discoveryengine.v1beta.TransactionInfo.cost]
         
        optional float discount_value = 6;
        Specified by:
        hasDiscountValue in interface TransactionInfoOrBuilder
        Returns:
        Whether the discountValue field is set.
      • getDiscountValue

        public float getDiscountValue()
         The total discount(s) value applied to this transaction.
         This figure should be excluded from
         [TransactionInfo.value][google.cloud.discoveryengine.v1beta.TransactionInfo.value]
        
         For example, if a user paid
         [TransactionInfo.value][google.cloud.discoveryengine.v1beta.TransactionInfo.value]
         amount, then nominal (pre-discount) value of the transaction is the sum of
         [TransactionInfo.value][google.cloud.discoveryengine.v1beta.TransactionInfo.value]
         and
         [TransactionInfo.discount_value][google.cloud.discoveryengine.v1beta.TransactionInfo.discount_value]
        
         This means that profit is calculated the same way, regardless of the
         discount value, and that
         [TransactionInfo.discount_value][google.cloud.discoveryengine.v1beta.TransactionInfo.discount_value]
         can be larger than
         [TransactionInfo.value][google.cloud.discoveryengine.v1beta.TransactionInfo.value]:
        
         * Profit =
         [value][google.cloud.discoveryengine.v1beta.TransactionInfo.value] -
         [tax][google.cloud.discoveryengine.v1beta.TransactionInfo.tax] -
         [cost][google.cloud.discoveryengine.v1beta.TransactionInfo.cost]
         
        optional float discount_value = 6;
        Specified by:
        getDiscountValue in interface TransactionInfoOrBuilder
        Returns:
        The discountValue.
      • setDiscountValue

        public TransactionInfo.Builder setDiscountValue​(float value)
         The total discount(s) value applied to this transaction.
         This figure should be excluded from
         [TransactionInfo.value][google.cloud.discoveryengine.v1beta.TransactionInfo.value]
        
         For example, if a user paid
         [TransactionInfo.value][google.cloud.discoveryengine.v1beta.TransactionInfo.value]
         amount, then nominal (pre-discount) value of the transaction is the sum of
         [TransactionInfo.value][google.cloud.discoveryengine.v1beta.TransactionInfo.value]
         and
         [TransactionInfo.discount_value][google.cloud.discoveryengine.v1beta.TransactionInfo.discount_value]
        
         This means that profit is calculated the same way, regardless of the
         discount value, and that
         [TransactionInfo.discount_value][google.cloud.discoveryengine.v1beta.TransactionInfo.discount_value]
         can be larger than
         [TransactionInfo.value][google.cloud.discoveryengine.v1beta.TransactionInfo.value]:
        
         * Profit =
         [value][google.cloud.discoveryengine.v1beta.TransactionInfo.value] -
         [tax][google.cloud.discoveryengine.v1beta.TransactionInfo.tax] -
         [cost][google.cloud.discoveryengine.v1beta.TransactionInfo.cost]
         
        optional float discount_value = 6;
        Parameters:
        value - The discountValue to set.
        Returns:
        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][google.cloud.discoveryengine.v1beta.TransactionInfo.value]
        
         For example, if a user paid
         [TransactionInfo.value][google.cloud.discoveryengine.v1beta.TransactionInfo.value]
         amount, then nominal (pre-discount) value of the transaction is the sum of
         [TransactionInfo.value][google.cloud.discoveryengine.v1beta.TransactionInfo.value]
         and
         [TransactionInfo.discount_value][google.cloud.discoveryengine.v1beta.TransactionInfo.discount_value]
        
         This means that profit is calculated the same way, regardless of the
         discount value, and that
         [TransactionInfo.discount_value][google.cloud.discoveryengine.v1beta.TransactionInfo.discount_value]
         can be larger than
         [TransactionInfo.value][google.cloud.discoveryengine.v1beta.TransactionInfo.value]:
        
         * Profit =
         [value][google.cloud.discoveryengine.v1beta.TransactionInfo.value] -
         [tax][google.cloud.discoveryengine.v1beta.TransactionInfo.tax] -
         [cost][google.cloud.discoveryengine.v1beta.TransactionInfo.cost]
         
        optional float discount_value = 6;
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final TransactionInfo.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<TransactionInfo.Builder>
      • mergeUnknownFields

        public final TransactionInfo.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<TransactionInfo.Builder>