Class CustomFixedFee


public class CustomFixedFee extends CustomFeeBase<CustomFixedFee>
Custom fixed fee utility class. See Hedera Documentation
  • Constructor Details

    • CustomFixedFee

      public CustomFixedFee()
      Constructor.
  • Method Details

    • fromProtobuf

      static CustomFixedFee fromProtobuf(FixedFee fixedFee)
      Create a custom fixed fee from a fixed fee protobuf.
      Parameters:
      fixedFee - the fixed fee protobuf
      Returns:
      the new custom fixed fee object
    • fromProtobuf

      static CustomFixedFee fromProtobuf(FixedCustomFee fixedFee)
      Create a custom fixed fee from a fixed custom fee protobuf.

      This fee definition is specific to an Hedera Consensus Service (HCS) topic and SHOULD NOT be used in any other context.

      Parameters:
      fixedFee - the fixed custom fee protobuf
      Returns:
      the new custom fixed fee object
    • toTopicFeeProtobuf

      FixedCustomFee toTopicFeeProtobuf()
    • deepCloneSubclass

      CustomFixedFee deepCloneSubclass()
      Specified by:
      deepCloneSubclass in class CustomFeeBase<CustomFixedFee>
    • getAmount

      public long getAmount()
      Extract the amount.
      Returns:
      the amount of the fee in tiny bar
    • setAmount

      public CustomFixedFee setAmount(long amount)
      Assign the fee amount in tiny bar.
      Parameters:
      amount - the amount of the fee in tiny bar
      Returns:
      this
    • getHbarAmount

      public Hbar getHbarAmount()
      Extract the fee amount.
      Returns:
      the fee amount in hbar
    • setHbarAmount

      public CustomFixedFee setHbarAmount(Hbar amount)
      Assign the fee amount in hbar.
      Parameters:
      amount - the fee amount in hbar
      Returns:
      this
    • getDenominatingTokenId

      @Nullable public TokenId getDenominatingTokenId()
      Extract the token id.
      Returns:
      the token id object
    • setDenominatingTokenId

      public CustomFixedFee setDenominatingTokenId(@Nullable TokenId tokenId)
      Assign the desired token id.
      Parameters:
      tokenId - the token id
      Returns:
      this
    • setDenominatingTokenToSameToken

      public CustomFixedFee setDenominatingTokenToSameToken()
      Assign the default token 0.0.0.
      Returns:
      this
    • validateChecksums

      void validateChecksums(Client client) throws BadEntityIdException
      Description copied from class: CustomFee
      Verify the validity of the client object.
      Overrides:
      validateChecksums in class CustomFee
      Parameters:
      client - the configured client
      Throws:
      BadEntityIdException - if entity ID is formatted poorly
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toFixedFeeProtobuf

      FixedFee toFixedFeeProtobuf()
      Convert to a protobuf.
      Returns:
      the protobuf converted object
    • toProtobuf

      CustomFee toProtobuf()
      Description copied from class: CustomFee
      Create the protobuf.
      Specified by:
      toProtobuf in class CustomFee
      Returns:
      the protobuf for the custom fee object