Class FractionalFee.Builder

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

public static final class FractionalFee.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<FractionalFee,FractionalFee.Builder> implements FractionalFeeOrBuilder
 *
 A descriptor for a fee based on a portion of the tokens transferred.

 This fee option describes fees as a fraction of the amount of
 fungible/common token(s) transferred.  The fee also describes a minimum
 and maximum amount, both of which are OPTIONAL.

 This type of fee SHALL be assessed only for fungible/common tokens.<br/>
 This type of fee MUST NOT be defined for a non-fungible/unique
 token type.<br/>
 This fee SHALL be paid with the same type of tokens as those
 transferred.<br/>
 The fee MAY be subtracted from the transferred tokens, or MAY be assessed
 to the sender in addition to the tokens actually transferred, based on
 the `net_of_transfers` field.

 When a single transaction sends tokens from one sender to multiple
 recipients, and the `net_of_transfers` flag is false, the network
 SHALL attempt to evenly assess the total fee across all recipients
 proportionally. This may be inexact and, particularly when there are
 large differences between recipients, MAY result in small deviations
 from an ideal "fair" distribution.<br/>
 If the sender lacks sufficient tokens to pay fees, or the assessment
 of custom fees reduces the net amount transferred to or below zero,
 the transaction MAY fail due to insufficient funds to pay all fees.
 
Protobuf type proto.FractionalFee
  • Field Summary

    Fields inherited from class com.google.protobuf.GeneratedMessageLite.Builder

    instance
  • Method Summary

    Modifier and Type
    Method
    Description
    * A Fraction of the transferred tokens to assess as a fee.<br/> This value MUST be less than or equal to one.<br/> This value MUST be greater than zero.
    * A maximum fee to charge, in units of 10<sup>-decimals</sup> tokens.
    * A minimum fee to charge, in units of 10<sup>-decimals</sup> tokens.
    * Flag requesting to assess the calculated fee against the sender, without reducing the amount transferred.<br/> #### Effects of this flag <ol> <li>If this value is true <ul> <li>The receiver of a transfer SHALL receive the entire amount sent.</li> <li>The fee SHALL be charged to the sender as an additional amount, increasing the token transfer debit.</li> </ul> </li> <li>If this value is false <ul> <li>The receiver of a transfer SHALL receive the amount sent _after_ deduction of the calculated fee.</li> </ul> </li> </ol>
    * A Fraction of the transferred tokens to assess as a fee.<br/> This value MUST be less than or equal to one.<br/> This value MUST be greater than zero.
    long
    * A maximum fee to charge, in units of 10<sup>-decimals</sup> tokens.
    long
    * A minimum fee to charge, in units of 10<sup>-decimals</sup> tokens.
    boolean
    * Flag requesting to assess the calculated fee against the sender, without reducing the amount transferred.<br/> #### Effects of this flag <ol> <li>If this value is true <ul> <li>The receiver of a transfer SHALL receive the entire amount sent.</li> <li>The fee SHALL be charged to the sender as an additional amount, increasing the token transfer debit.</li> </ul> </li> <li>If this value is false <ul> <li>The receiver of a transfer SHALL receive the amount sent _after_ deduction of the calculated fee.</li> </ul> </li> </ol>
    boolean
    * A Fraction of the transferred tokens to assess as a fee.<br/> This value MUST be less than or equal to one.<br/> This value MUST be greater than zero.
    * A Fraction of the transferred tokens to assess as a fee.<br/> This value MUST be less than or equal to one.<br/> This value MUST be greater than zero.
    * A Fraction of the transferred tokens to assess as a fee.<br/> This value MUST be less than or equal to one.<br/> This value MUST be greater than zero.
    * A Fraction of the transferred tokens to assess as a fee.<br/> This value MUST be less than or equal to one.<br/> This value MUST be greater than zero.
    setMaximumAmount(long value)
    * A maximum fee to charge, in units of 10<sup>-decimals</sup> tokens.
    setMinimumAmount(long value)
    * A minimum fee to charge, in units of 10<sup>-decimals</sup> tokens.
    setNetOfTransfers(boolean value)
    * Flag requesting to assess the calculated fee against the sender, without reducing the amount transferred.<br/> #### Effects of this flag <ol> <li>If this value is true <ul> <li>The receiver of a transfer SHALL receive the entire amount sent.</li> <li>The fee SHALL be charged to the sender as an additional amount, increasing the token transfer debit.</li> </ul> </li> <li>If this value is false <ul> <li>The receiver of a transfer SHALL receive the amount sent _after_ deduction of the calculated fee.</li> </ul> </li> </ol>

    Methods inherited from class com.google.protobuf.GeneratedMessageLite.Builder

    build, buildPartial, clear, clone, copyOnWrite, copyOnWriteInternal, getDefaultInstanceForType, internalMergeFrom, isInitialized, mergeFrom, mergeFrom, mergeFrom, mergeFrom

    Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

    addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder

    getDefaultInstanceForType, isInitialized
  • Method Details

    • hasFractionalAmount

      public boolean hasFractionalAmount()
       *
       A Fraction of the transferred tokens to assess as a fee.<br/>
       This value MUST be less than or equal to one.<br/>
       This value MUST be greater than zero.
       
      .proto.Fraction fractional_amount = 1;
      Specified by:
      hasFractionalAmount in interface FractionalFeeOrBuilder
      Returns:
      Whether the fractionalAmount field is set.
    • getFractionalAmount

      public Fraction getFractionalAmount()
       *
       A Fraction of the transferred tokens to assess as a fee.<br/>
       This value MUST be less than or equal to one.<br/>
       This value MUST be greater than zero.
       
      .proto.Fraction fractional_amount = 1;
      Specified by:
      getFractionalAmount in interface FractionalFeeOrBuilder
      Returns:
      The fractionalAmount.
    • setFractionalAmount

      public FractionalFee.Builder setFractionalAmount(Fraction value)
       *
       A Fraction of the transferred tokens to assess as a fee.<br/>
       This value MUST be less than or equal to one.<br/>
       This value MUST be greater than zero.
       
      .proto.Fraction fractional_amount = 1;
    • setFractionalAmount

      public FractionalFee.Builder setFractionalAmount(Fraction.Builder builderForValue)
       *
       A Fraction of the transferred tokens to assess as a fee.<br/>
       This value MUST be less than or equal to one.<br/>
       This value MUST be greater than zero.
       
      .proto.Fraction fractional_amount = 1;
    • mergeFractionalAmount

      public FractionalFee.Builder mergeFractionalAmount(Fraction value)
       *
       A Fraction of the transferred tokens to assess as a fee.<br/>
       This value MUST be less than or equal to one.<br/>
       This value MUST be greater than zero.
       
      .proto.Fraction fractional_amount = 1;
    • clearFractionalAmount

      public FractionalFee.Builder clearFractionalAmount()
       *
       A Fraction of the transferred tokens to assess as a fee.<br/>
       This value MUST be less than or equal to one.<br/>
       This value MUST be greater than zero.
       
      .proto.Fraction fractional_amount = 1;
    • getMinimumAmount

      public long getMinimumAmount()
       *
       A minimum fee to charge, in units of 10<sup>-decimals</sup> tokens.
       <p>
       This value is OPTIONAL, with a default of `0` indicating no minimum.<br/>
       If set, this value MUST be greater than zero.<br/>
       If set, all transfers SHALL pay at least this amount.
       
      int64 minimum_amount = 2;
      Specified by:
      getMinimumAmount in interface FractionalFeeOrBuilder
      Returns:
      The minimumAmount.
    • setMinimumAmount

      public FractionalFee.Builder setMinimumAmount(long value)
       *
       A minimum fee to charge, in units of 10<sup>-decimals</sup> tokens.
       <p>
       This value is OPTIONAL, with a default of `0` indicating no minimum.<br/>
       If set, this value MUST be greater than zero.<br/>
       If set, all transfers SHALL pay at least this amount.
       
      int64 minimum_amount = 2;
      Parameters:
      value - The minimumAmount to set.
      Returns:
      This builder for chaining.
    • clearMinimumAmount

      public FractionalFee.Builder clearMinimumAmount()
       *
       A minimum fee to charge, in units of 10<sup>-decimals</sup> tokens.
       <p>
       This value is OPTIONAL, with a default of `0` indicating no minimum.<br/>
       If set, this value MUST be greater than zero.<br/>
       If set, all transfers SHALL pay at least this amount.
       
      int64 minimum_amount = 2;
      Returns:
      This builder for chaining.
    • getMaximumAmount

      public long getMaximumAmount()
       *
       A maximum fee to charge, in units of 10<sup>-decimals</sup> tokens.
       <p>
       This value is OPTIONAL, with a default of `0` indicating no maximum.<br/>
       If set, this value MUST be greater than zero.<br/>
       If set, any fee charged SHALL NOT exceed this value.<br/>
       This value SHOULD be strictly greater than `minimum_amount`.
       If this amount is less than or equal to `minimum_amount`, then
       the fee charged SHALL always be equal to this value and
       `fractional_amount` SHALL NOT have any effect.
       
      int64 maximum_amount = 3;
      Specified by:
      getMaximumAmount in interface FractionalFeeOrBuilder
      Returns:
      The maximumAmount.
    • setMaximumAmount

      public FractionalFee.Builder setMaximumAmount(long value)
       *
       A maximum fee to charge, in units of 10<sup>-decimals</sup> tokens.
       <p>
       This value is OPTIONAL, with a default of `0` indicating no maximum.<br/>
       If set, this value MUST be greater than zero.<br/>
       If set, any fee charged SHALL NOT exceed this value.<br/>
       This value SHOULD be strictly greater than `minimum_amount`.
       If this amount is less than or equal to `minimum_amount`, then
       the fee charged SHALL always be equal to this value and
       `fractional_amount` SHALL NOT have any effect.
       
      int64 maximum_amount = 3;
      Parameters:
      value - The maximumAmount to set.
      Returns:
      This builder for chaining.
    • clearMaximumAmount

      public FractionalFee.Builder clearMaximumAmount()
       *
       A maximum fee to charge, in units of 10<sup>-decimals</sup> tokens.
       <p>
       This value is OPTIONAL, with a default of `0` indicating no maximum.<br/>
       If set, this value MUST be greater than zero.<br/>
       If set, any fee charged SHALL NOT exceed this value.<br/>
       This value SHOULD be strictly greater than `minimum_amount`.
       If this amount is less than or equal to `minimum_amount`, then
       the fee charged SHALL always be equal to this value and
       `fractional_amount` SHALL NOT have any effect.
       
      int64 maximum_amount = 3;
      Returns:
      This builder for chaining.
    • getNetOfTransfers

      public boolean getNetOfTransfers()
       *
       Flag requesting to assess the calculated fee against the sender,
       without reducing the amount transferred.<br/>
       #### Effects of this flag
       <ol>
       <li>If this value is true
       <ul>
       <li>The receiver of a transfer SHALL receive the entire
       amount sent.</li>
       <li>The fee SHALL be charged to the sender as an additional
       amount, increasing the token transfer debit.</li>
       </ul>
       </li>
       <li>If this value is false
       <ul>
       <li>The receiver of a transfer SHALL receive the amount sent
       _after_ deduction of the calculated fee.</li>
       </ul>
       </li>
       </ol>
       
      bool net_of_transfers = 4;
      Specified by:
      getNetOfTransfers in interface FractionalFeeOrBuilder
      Returns:
      The netOfTransfers.
    • setNetOfTransfers

      public FractionalFee.Builder setNetOfTransfers(boolean value)
       *
       Flag requesting to assess the calculated fee against the sender,
       without reducing the amount transferred.<br/>
       #### Effects of this flag
       <ol>
       <li>If this value is true
       <ul>
       <li>The receiver of a transfer SHALL receive the entire
       amount sent.</li>
       <li>The fee SHALL be charged to the sender as an additional
       amount, increasing the token transfer debit.</li>
       </ul>
       </li>
       <li>If this value is false
       <ul>
       <li>The receiver of a transfer SHALL receive the amount sent
       _after_ deduction of the calculated fee.</li>
       </ul>
       </li>
       </ol>
       
      bool net_of_transfers = 4;
      Parameters:
      value - The netOfTransfers to set.
      Returns:
      This builder for chaining.
    • clearNetOfTransfers

      public FractionalFee.Builder clearNetOfTransfers()
       *
       Flag requesting to assess the calculated fee against the sender,
       without reducing the amount transferred.<br/>
       #### Effects of this flag
       <ol>
       <li>If this value is true
       <ul>
       <li>The receiver of a transfer SHALL receive the entire
       amount sent.</li>
       <li>The fee SHALL be charged to the sender as an additional
       amount, increasing the token transfer debit.</li>
       </ul>
       </li>
       <li>If this value is false
       <ul>
       <li>The receiver of a transfer SHALL receive the amount sent
       _after_ deduction of the calculated fee.</li>
       </ul>
       </li>
       </ol>
       
      bool net_of_transfers = 4;
      Returns:
      This builder for chaining.