Class PurchaseTransaction.Builder

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

    public static final class PurchaseTransaction.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<PurchaseTransaction.Builder>
    implements PurchaseTransactionOrBuilder
     A transaction represents the entire purchase transaction.
     
    Protobuf type google.cloud.retail.v2.PurchaseTransaction
    • 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<PurchaseTransaction.Builder>
      • clear

        public PurchaseTransaction.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<PurchaseTransaction.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<PurchaseTransaction.Builder>
      • getDefaultInstanceForType

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

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

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

        public PurchaseTransaction.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<PurchaseTransaction.Builder>
      • setField

        public PurchaseTransaction.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<PurchaseTransaction.Builder>
      • clearField

        public PurchaseTransaction.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<PurchaseTransaction.Builder>
      • clearOneof

        public PurchaseTransaction.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<PurchaseTransaction.Builder>
      • setRepeatedField

        public PurchaseTransaction.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<PurchaseTransaction.Builder>
      • addRepeatedField

        public PurchaseTransaction.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<PurchaseTransaction.Builder>
      • mergeFrom

        public PurchaseTransaction.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<PurchaseTransaction.Builder>
      • isInitialized

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

        public PurchaseTransaction.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<PurchaseTransaction.Builder>
        Throws:
        IOException
      • getIdBytes

        public com.google.protobuf.ByteString getIdBytes()
         The transaction ID with a length limit of 128 characters.
         
        string id = 1;
        Specified by:
        getIdBytes in interface PurchaseTransactionOrBuilder
        Returns:
        The bytes for id.
      • setId

        public PurchaseTransaction.Builder setId​(String value)
         The transaction ID with a length limit of 128 characters.
         
        string id = 1;
        Parameters:
        value - The id to set.
        Returns:
        This builder for chaining.
      • clearId

        public PurchaseTransaction.Builder clearId()
         The transaction ID with a length limit of 128 characters.
         
        string id = 1;
        Returns:
        This builder for chaining.
      • setIdBytes

        public PurchaseTransaction.Builder setIdBytes​(com.google.protobuf.ByteString value)
         The transaction ID with a length limit of 128 characters.
         
        string id = 1;
        Parameters:
        value - The bytes for id to set.
        Returns:
        This builder for chaining.
      • getRevenue

        public float getRevenue()
         Required. Total non-zero revenue or grand total associated with the
         transaction. This value include shipping, tax, or other adjustments to
         total revenue that you want to include as part of your revenue
         calculations.
         
        float revenue = 2 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getRevenue in interface PurchaseTransactionOrBuilder
        Returns:
        The revenue.
      • setRevenue

        public PurchaseTransaction.Builder setRevenue​(float value)
         Required. Total non-zero revenue or grand total associated with the
         transaction. This value include shipping, tax, or other adjustments to
         total revenue that you want to include as part of your revenue
         calculations.
         
        float revenue = 2 [(.google.api.field_behavior) = REQUIRED];
        Parameters:
        value - The revenue to set.
        Returns:
        This builder for chaining.
      • clearRevenue

        public PurchaseTransaction.Builder clearRevenue()
         Required. Total non-zero revenue or grand total associated with the
         transaction. This value include shipping, tax, or other adjustments to
         total revenue that you want to include as part of your revenue
         calculations.
         
        float revenue = 2 [(.google.api.field_behavior) = REQUIRED];
        Returns:
        This builder for chaining.
      • getTax

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

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

        public PurchaseTransaction.Builder clearTax()
         All the taxes associated with the transaction.
         
        float tax = 3;
        Returns:
        This builder for chaining.
      • 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 = [revenue][google.cloud.retail.v2.PurchaseTransaction.revenue] -
         [tax][google.cloud.retail.v2.PurchaseTransaction.tax] -
         [cost][google.cloud.retail.v2.PurchaseTransaction.cost]
         
        float cost = 4;
        Specified by:
        getCost in interface PurchaseTransactionOrBuilder
        Returns:
        The cost.
      • setCost

        public PurchaseTransaction.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 = [revenue][google.cloud.retail.v2.PurchaseTransaction.revenue] -
         [tax][google.cloud.retail.v2.PurchaseTransaction.tax] -
         [cost][google.cloud.retail.v2.PurchaseTransaction.cost]
         
        float cost = 4;
        Parameters:
        value - The cost to set.
        Returns:
        This builder for chaining.
      • clearCost

        public PurchaseTransaction.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 = [revenue][google.cloud.retail.v2.PurchaseTransaction.revenue] -
         [tax][google.cloud.retail.v2.PurchaseTransaction.tax] -
         [cost][google.cloud.retail.v2.PurchaseTransaction.cost]
         
        float cost = 4;
        Returns:
        This builder for chaining.
      • getCurrencyCode

        public String getCurrencyCode()
         Required. Currency code. Use three-character ISO-4217 code.
         
        string currency_code = 5 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getCurrencyCode in interface PurchaseTransactionOrBuilder
        Returns:
        The currencyCode.
      • getCurrencyCodeBytes

        public com.google.protobuf.ByteString getCurrencyCodeBytes()
         Required. Currency code. Use three-character ISO-4217 code.
         
        string currency_code = 5 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getCurrencyCodeBytes in interface PurchaseTransactionOrBuilder
        Returns:
        The bytes for currencyCode.
      • setCurrencyCode

        public PurchaseTransaction.Builder setCurrencyCode​(String value)
         Required. Currency code. Use three-character ISO-4217 code.
         
        string currency_code = 5 [(.google.api.field_behavior) = REQUIRED];
        Parameters:
        value - The currencyCode to set.
        Returns:
        This builder for chaining.
      • clearCurrencyCode

        public PurchaseTransaction.Builder clearCurrencyCode()
         Required. Currency code. Use three-character ISO-4217 code.
         
        string currency_code = 5 [(.google.api.field_behavior) = REQUIRED];
        Returns:
        This builder for chaining.
      • setCurrencyCodeBytes

        public PurchaseTransaction.Builder setCurrencyCodeBytes​(com.google.protobuf.ByteString value)
         Required. Currency code. Use three-character ISO-4217 code.
         
        string currency_code = 5 [(.google.api.field_behavior) = REQUIRED];
        Parameters:
        value - The bytes for currencyCode to set.
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final PurchaseTransaction.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<PurchaseTransaction.Builder>
      • mergeUnknownFields

        public final PurchaseTransaction.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<PurchaseTransaction.Builder>