Class CustomFee

java.lang.Object
com.hedera.hashgraph.sdk.CustomFee
Direct Known Subclasses:
CustomFeeBase

public abstract class CustomFee extends Object
Base class for custom fees.
  • Field Details

    • feeCollectorAccountId

      @Nullable protected AccountId feeCollectorAccountId
      The account to receive the custom fee
    • allCollectorsAreExempt

      protected boolean allCollectorsAreExempt
      If true, exempts all the token's fee collection accounts from this fee
  • Constructor Details

    • CustomFee

      CustomFee()
      Constructor.
  • Method Details

    • fromProtobufInner

      static CustomFee fromProtobufInner(CustomFee customFee)
      Convert the protobuf object to a custom fee object.
      Parameters:
      customFee - protobuf response object
      Returns:
      the converted custom fee object
    • fromProtobuf

      static CustomFee fromProtobuf(CustomFee customFee)
    • fromBytes

      public static CustomFee fromBytes(byte[] bytes) throws com.google.protobuf.InvalidProtocolBufferException
      Convert byte array to a custom fee object.
      Parameters:
      bytes - the byte array
      Returns:
      the converted custom fee object
      Throws:
      com.google.protobuf.InvalidProtocolBufferException - when there is an issue with the protobuf
    • deepCloneList

      public static List<CustomFee> deepCloneList(List<CustomFee> customFees)
      Create a new copy of a custom fee list.
      Parameters:
      customFees - existing custom fee list
      Returns:
      new custom fee list
    • getFeeCollectorAccountId

      @Nullable public AccountId getFeeCollectorAccountId()
      Extract the fee collector account id.
      Returns:
      the fee collector account id
    • getAllCollectorsAreExempt

      public boolean getAllCollectorsAreExempt()
      Returns:
      whether all fee collectors are exempt from fees
    • deepClone

      abstract CustomFee deepClone()
      Create a deep clone.
      Returns:
      the correct cloned fee type
    • validateChecksums

      void validateChecksums(Client client) throws BadEntityIdException
      Verify the validity of the client object.
      Parameters:
      client - the configured client
      Throws:
      BadEntityIdException - if entity ID is formatted poorly
    • finishToProtobuf

      protected CustomFee finishToProtobuf(CustomFee.Builder customFeeBuilder)
      Finalize the builder into the protobuf.
      Parameters:
      customFeeBuilder - the builder object
      Returns:
      the protobuf
    • toProtobuf

      abstract CustomFee toProtobuf()
      Create the protobuf.
      Returns:
      the protobuf for the custom fee object
    • toBytes

      public byte[] toBytes()
      Create the byte array.
      Returns:
      the byte array representing the protobuf
    • toStringHelper

      protected com.google.common.base.MoreObjects.ToStringHelper toStringHelper()
      Serializes the class to ToStringHelper
      Returns:
      the MoreObjects.ToStringHelper