Class CustomFee.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<CustomFee,CustomFee.Builder>
com.google.protobuf.GeneratedMessageLite.Builder<CustomFee,CustomFee.Builder>
com.hedera.hashgraph.sdk.proto.CustomFee.Builder
All Implemented Interfaces:
com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, CustomFeeOrBuilder, Cloneable
Enclosing class:
CustomFee

public static final class CustomFee.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<CustomFee,CustomFee.Builder> implements CustomFeeOrBuilder
 *
 A transfer fee to assess during a CryptoTransfer.<br/>
 This fee applies to transactions that transfer units of the token to
 which the fee is attached. A custom fee may be either fixed or fractional,
 and must specify a fee collector account to receive the assessed fees.

 Custom fees MUST be greater than zero (0).
 
Protobuf type proto.CustomFee
  • Method Details

    • getFeeCase

      public CustomFee.FeeCase getFeeCase()
      Specified by:
      getFeeCase in interface CustomFeeOrBuilder
    • clearFee

      public CustomFee.Builder clearFee()
    • hasFixedFee

      public boolean hasFixedFee()
       *
       A fixed fee to be charged to the `sender` for every token transfer.
       <p>
       This type of fee MAY be defined for any token type.<br/>
       This type of fee MAY be more consistent and reliable than
       other types.
       
      .proto.FixedFee fixed_fee = 1;
      Specified by:
      hasFixedFee in interface CustomFeeOrBuilder
      Returns:
      Whether the fixedFee field is set.
    • getFixedFee

      public FixedFee getFixedFee()
       *
       A fixed fee to be charged to the `sender` for every token transfer.
       <p>
       This type of fee MAY be defined for any token type.<br/>
       This type of fee MAY be more consistent and reliable than
       other types.
       
      .proto.FixedFee fixed_fee = 1;
      Specified by:
      getFixedFee in interface CustomFeeOrBuilder
      Returns:
      The fixedFee.
    • setFixedFee

      public CustomFee.Builder setFixedFee(FixedFee value)
       *
       A fixed fee to be charged to the `sender` for every token transfer.
       <p>
       This type of fee MAY be defined for any token type.<br/>
       This type of fee MAY be more consistent and reliable than
       other types.
       
      .proto.FixedFee fixed_fee = 1;
    • setFixedFee

      public CustomFee.Builder setFixedFee(FixedFee.Builder builderForValue)
       *
       A fixed fee to be charged to the `sender` for every token transfer.
       <p>
       This type of fee MAY be defined for any token type.<br/>
       This type of fee MAY be more consistent and reliable than
       other types.
       
      .proto.FixedFee fixed_fee = 1;
    • mergeFixedFee

      public CustomFee.Builder mergeFixedFee(FixedFee value)
       *
       A fixed fee to be charged to the `sender` for every token transfer.
       <p>
       This type of fee MAY be defined for any token type.<br/>
       This type of fee MAY be more consistent and reliable than
       other types.
       
      .proto.FixedFee fixed_fee = 1;
    • clearFixedFee

      public CustomFee.Builder clearFixedFee()
       *
       A fixed fee to be charged to the `sender` for every token transfer.
       <p>
       This type of fee MAY be defined for any token type.<br/>
       This type of fee MAY be more consistent and reliable than
       other types.
       
      .proto.FixedFee fixed_fee = 1;
    • hasFractionalFee

      public boolean hasFractionalFee()
       *
       A fee defined as a fraction of the tokens transferred.
       <p>
       This type of fee MUST NOT be defined for a non-fungible/unique
       token type.<br/>
       This fee MAY be charged to either sender, as an increase to the
       amount sent, or receiver, as a reduction to the amount received.
       
      .proto.FractionalFee fractional_fee = 2;
      Specified by:
      hasFractionalFee in interface CustomFeeOrBuilder
      Returns:
      Whether the fractionalFee field is set.
    • getFractionalFee

      public FractionalFee getFractionalFee()
       *
       A fee defined as a fraction of the tokens transferred.
       <p>
       This type of fee MUST NOT be defined for a non-fungible/unique
       token type.<br/>
       This fee MAY be charged to either sender, as an increase to the
       amount sent, or receiver, as a reduction to the amount received.
       
      .proto.FractionalFee fractional_fee = 2;
      Specified by:
      getFractionalFee in interface CustomFeeOrBuilder
      Returns:
      The fractionalFee.
    • setFractionalFee

      public CustomFee.Builder setFractionalFee(FractionalFee value)
       *
       A fee defined as a fraction of the tokens transferred.
       <p>
       This type of fee MUST NOT be defined for a non-fungible/unique
       token type.<br/>
       This fee MAY be charged to either sender, as an increase to the
       amount sent, or receiver, as a reduction to the amount received.
       
      .proto.FractionalFee fractional_fee = 2;
    • setFractionalFee

      public CustomFee.Builder setFractionalFee(FractionalFee.Builder builderForValue)
       *
       A fee defined as a fraction of the tokens transferred.
       <p>
       This type of fee MUST NOT be defined for a non-fungible/unique
       token type.<br/>
       This fee MAY be charged to either sender, as an increase to the
       amount sent, or receiver, as a reduction to the amount received.
       
      .proto.FractionalFee fractional_fee = 2;
    • mergeFractionalFee

      public CustomFee.Builder mergeFractionalFee(FractionalFee value)
       *
       A fee defined as a fraction of the tokens transferred.
       <p>
       This type of fee MUST NOT be defined for a non-fungible/unique
       token type.<br/>
       This fee MAY be charged to either sender, as an increase to the
       amount sent, or receiver, as a reduction to the amount received.
       
      .proto.FractionalFee fractional_fee = 2;
    • clearFractionalFee

      public CustomFee.Builder clearFractionalFee()
       *
       A fee defined as a fraction of the tokens transferred.
       <p>
       This type of fee MUST NOT be defined for a non-fungible/unique
       token type.<br/>
       This fee MAY be charged to either sender, as an increase to the
       amount sent, or receiver, as a reduction to the amount received.
       
      .proto.FractionalFee fractional_fee = 2;
    • hasRoyaltyFee

      public boolean hasRoyaltyFee()
       *
       A fee charged as royalty for any transfer of a
       non-fungible/unique token.
       <p>
       This type of fee MUST NOT be defined for a
       fungible/common token type.
       
      .proto.RoyaltyFee royalty_fee = 4;
      Specified by:
      hasRoyaltyFee in interface CustomFeeOrBuilder
      Returns:
      Whether the royaltyFee field is set.
    • getRoyaltyFee

      public RoyaltyFee getRoyaltyFee()
       *
       A fee charged as royalty for any transfer of a
       non-fungible/unique token.
       <p>
       This type of fee MUST NOT be defined for a
       fungible/common token type.
       
      .proto.RoyaltyFee royalty_fee = 4;
      Specified by:
      getRoyaltyFee in interface CustomFeeOrBuilder
      Returns:
      The royaltyFee.
    • setRoyaltyFee

      public CustomFee.Builder setRoyaltyFee(RoyaltyFee value)
       *
       A fee charged as royalty for any transfer of a
       non-fungible/unique token.
       <p>
       This type of fee MUST NOT be defined for a
       fungible/common token type.
       
      .proto.RoyaltyFee royalty_fee = 4;
    • setRoyaltyFee

      public CustomFee.Builder setRoyaltyFee(RoyaltyFee.Builder builderForValue)
       *
       A fee charged as royalty for any transfer of a
       non-fungible/unique token.
       <p>
       This type of fee MUST NOT be defined for a
       fungible/common token type.
       
      .proto.RoyaltyFee royalty_fee = 4;
    • mergeRoyaltyFee

      public CustomFee.Builder mergeRoyaltyFee(RoyaltyFee value)
       *
       A fee charged as royalty for any transfer of a
       non-fungible/unique token.
       <p>
       This type of fee MUST NOT be defined for a
       fungible/common token type.
       
      .proto.RoyaltyFee royalty_fee = 4;
    • clearRoyaltyFee

      public CustomFee.Builder clearRoyaltyFee()
       *
       A fee charged as royalty for any transfer of a
       non-fungible/unique token.
       <p>
       This type of fee MUST NOT be defined for a
       fungible/common token type.
       
      .proto.RoyaltyFee royalty_fee = 4;
    • hasFeeCollectorAccountId

      public boolean hasFeeCollectorAccountId()
       *
       The account to receive the custom fee.
       
      .proto.AccountID fee_collector_account_id = 3;
      Specified by:
      hasFeeCollectorAccountId in interface CustomFeeOrBuilder
      Returns:
      Whether the feeCollectorAccountId field is set.
    • getFeeCollectorAccountId

      public AccountID getFeeCollectorAccountId()
       *
       The account to receive the custom fee.
       
      .proto.AccountID fee_collector_account_id = 3;
      Specified by:
      getFeeCollectorAccountId in interface CustomFeeOrBuilder
      Returns:
      The feeCollectorAccountId.
    • setFeeCollectorAccountId

      public CustomFee.Builder setFeeCollectorAccountId(AccountID value)
       *
       The account to receive the custom fee.
       
      .proto.AccountID fee_collector_account_id = 3;
    • setFeeCollectorAccountId

      public CustomFee.Builder setFeeCollectorAccountId(AccountID.Builder builderForValue)
       *
       The account to receive the custom fee.
       
      .proto.AccountID fee_collector_account_id = 3;
    • mergeFeeCollectorAccountId

      public CustomFee.Builder mergeFeeCollectorAccountId(AccountID value)
       *
       The account to receive the custom fee.
       
      .proto.AccountID fee_collector_account_id = 3;
    • clearFeeCollectorAccountId

      public CustomFee.Builder clearFeeCollectorAccountId()
       *
       The account to receive the custom fee.
       
      .proto.AccountID fee_collector_account_id = 3;
    • getAllCollectorsAreExempt

      public boolean getAllCollectorsAreExempt()
       *
       Flag indicating to exempt all custom fee collector accounts for this
       token type from paying this custom fee when sending tokens.
       <p>
       The treasury account for a token, and the account identified by the
       `fee_collector_account_id` field of this `CustomFee` are always exempt
       from this custom fee to avoid redundant and unnecessary transfers.
       If this value is `true` then the account(s) identified in
       `fee_collector_account_id` for _all_ custom fee definitions for this
       token type SHALL also be exempt from this custom fee.
       This behavior is specified in HIP-573.
       
      bool all_collectors_are_exempt = 5;
      Specified by:
      getAllCollectorsAreExempt in interface CustomFeeOrBuilder
      Returns:
      The allCollectorsAreExempt.
    • setAllCollectorsAreExempt

      public CustomFee.Builder setAllCollectorsAreExempt(boolean value)
       *
       Flag indicating to exempt all custom fee collector accounts for this
       token type from paying this custom fee when sending tokens.
       <p>
       The treasury account for a token, and the account identified by the
       `fee_collector_account_id` field of this `CustomFee` are always exempt
       from this custom fee to avoid redundant and unnecessary transfers.
       If this value is `true` then the account(s) identified in
       `fee_collector_account_id` for _all_ custom fee definitions for this
       token type SHALL also be exempt from this custom fee.
       This behavior is specified in HIP-573.
       
      bool all_collectors_are_exempt = 5;
      Parameters:
      value - The allCollectorsAreExempt to set.
      Returns:
      This builder for chaining.
    • clearAllCollectorsAreExempt

      public CustomFee.Builder clearAllCollectorsAreExempt()
       *
       Flag indicating to exempt all custom fee collector accounts for this
       token type from paying this custom fee when sending tokens.
       <p>
       The treasury account for a token, and the account identified by the
       `fee_collector_account_id` field of this `CustomFee` are always exempt
       from this custom fee to avoid redundant and unnecessary transfers.
       If this value is `true` then the account(s) identified in
       `fee_collector_account_id` for _all_ custom fee definitions for this
       token type SHALL also be exempt from this custom fee.
       This behavior is specified in HIP-573.
       
      bool all_collectors_are_exempt = 5;
      Returns:
      This builder for chaining.