java.lang.Object
com.hedera.hashgraph.sdk.CustomFee
- Direct Known Subclasses:
CustomFeeBase
Base class for custom fees.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanIf true, exempts all the token's fee collection accounts from this feeprotected AccountIdThe account to receive the custom fee -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) abstract CustomFeeCreate a deep clone.deepCloneList(List<CustomFee> customFees) Create a new copy of a custom fee list.protected CustomFeefinishToProtobuf(CustomFee.Builder customFeeBuilder) Finalize the builder into the protobuf.static CustomFeefromBytes(byte[] bytes) Convert byte array to a custom fee object.(package private) static CustomFeefromProtobuf(CustomFee customFee) (package private) static CustomFeefromProtobufInner(CustomFee customFee) Convert the protobuf object to a custom fee object.booleanExtract the fee collector account id.byte[]toBytes()Create the byte array.(package private) abstract CustomFeeCreate the protobuf.protected com.google.common.base.MoreObjects.ToStringHelperSerializes the class to ToStringHelper(package private) voidvalidateChecksums(Client client) Verify the validity of the client object.
-
Field Details
-
feeCollectorAccountId
The account to receive the custom fee -
allCollectorsAreExempt
protected boolean allCollectorsAreExemptIf true, exempts all the token's fee collection accounts from this fee
-
-
Constructor Details
-
CustomFee
CustomFee()Constructor.
-
-
Method Details
-
fromProtobufInner
Convert the protobuf object to a custom fee object.- Parameters:
customFee- protobuf response object- Returns:
- the converted custom fee object
-
fromProtobuf
-
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
Create a new copy of a custom fee list.- Parameters:
customFees- existing custom fee list- Returns:
- new custom fee list
-
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
Create a deep clone.- Returns:
- the correct cloned fee type
-
validateChecksums
Verify the validity of the client object.- Parameters:
client- the configured client- Throws:
BadEntityIdException- if entity ID is formatted poorly
-
finishToProtobuf
Finalize the builder into the protobuf.- Parameters:
customFeeBuilder- the builder object- Returns:
- the protobuf
-
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
-