Class FeeData

java.lang.Object
com.hedera.hashgraph.sdk.FeeData
All Implemented Interfaces:
Cloneable

public class FeeData extends Object implements Cloneable
The total fees charged for a transaction. It contains three parts namely node data, network data and service data.
  • Constructor Details

    • FeeData

      public FeeData()
      Constructor.
  • Method Details

    • fromProtobuf

      static FeeData fromProtobuf(FeeData feeData)
      Initialize fee data object from a protobuf.
      Parameters:
      feeData - the protobuf
      Returns:
      the fee data object
    • fromBytes

      public static FeeData fromBytes(byte[] bytes) throws com.google.protobuf.InvalidProtocolBufferException
      Initialize fee data object from byte array.
      Parameters:
      bytes - the byte array
      Returns:
      the fee data object
      Throws:
      com.google.protobuf.InvalidProtocolBufferException - when there is an issue with the protobuf
    • getNodeData

      @Nullable FeeComponents getNodeData()
      Extract the node data.
      Returns:
      the node data fee components object
    • setNodeData

      FeeData setNodeData(@Nullable FeeComponents nodeData)
      Assign the node data fee component object.
      Parameters:
      nodeData - the node data fee component object
      Returns:
      this
    • getNetworkData

      @Nullable FeeComponents getNetworkData()
      Extract the network data.
      Returns:
      the network data fee component object
    • setNetworkData

      FeeData setNetworkData(@Nullable FeeComponents networkData)
      Assign the network data fee component object.
      Parameters:
      networkData - the network data fee component object
      Returns:
      this
    • getServiceData

      @Nullable FeeComponents getServiceData()
      Extract the service data.
      Returns:
      the service data fee component object
    • setServiceData

      FeeData setServiceData(@Nullable FeeComponents serviceData)
      Assign the service data fee component object.
      Parameters:
      serviceData - the service data fee component object
      Returns:
      this
    • getType

      FeeDataType getType()
      Extract the fee data type.
      Returns:
      the fee data type
    • setType

      FeeData setType(FeeDataType type)
      Assign the fee data type. FeeDataType
      Parameters:
      type - the fee data type
      Returns:
      this
    • toProtobuf

      FeeData toProtobuf()
      Convert the fee data type into a protobuf.
      Returns:
      the protobuf
    • toString

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

      public byte[] toBytes()
      Create the byte array.
      Returns:
      a byte array representation
    • clone

      public FeeData clone()
      Overrides:
      clone in class Object