Custom fixed fee utility class.
See Hedera Documentation
-
Field Summary
Fields inherited from class com.hedera.hashgraph.sdk.CustomFee
allCollectorsAreExempt, feeCollectorAccountId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) CustomFixedFee(package private) static CustomFixedFeefromProtobuf(FixedCustomFee fixedFee) Create a custom fixed fee from a fixed custom fee protobuf.(package private) static CustomFixedFeefromProtobuf(FixedFee fixedFee) Create a custom fixed fee from a fixed fee protobuf.longExtract the amount.Extract the token id.Extract the fee amount.setAmount(long amount) Assign the fee amount in tiny bar.setDenominatingTokenId(TokenId tokenId) Assign the desired token id.Assign the default token 0.0.0.setHbarAmount(Hbar amount) Assign the fee amount in hbar.(package private) FixedFeeConvert to a protobuf.(package private) CustomFeeCreate the protobuf.toString()(package private) FixedCustomFee(package private) voidvalidateChecksums(Client client) Verify the validity of the client object.Methods inherited from class com.hedera.hashgraph.sdk.CustomFeeBase
deepClone, finishDeepClone, setAllCollectorsAreExempt, setFeeCollectorAccountIdMethods inherited from class com.hedera.hashgraph.sdk.CustomFee
deepCloneList, finishToProtobuf, fromBytes, fromProtobuf, fromProtobufInner, getAllCollectorsAreExempt, getFeeCollectorAccountId, toBytes, toStringHelper
-
Constructor Details
-
CustomFixedFee
public CustomFixedFee()Constructor.
-
-
Method Details
-
fromProtobuf
Create a custom fixed fee from a fixed fee protobuf.- Parameters:
fixedFee- the fixed fee protobuf- Returns:
- the new custom fixed fee object
-
fromProtobuf
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:
deepCloneSubclassin classCustomFeeBase<CustomFixedFee>
-
getAmount
public long getAmount()Extract the amount.- Returns:
- the amount of the fee in tiny bar
-
setAmount
Assign the fee amount in tiny bar.- Parameters:
amount- the amount of the fee in tiny bar- Returns:
this
-
getHbarAmount
Extract the fee amount.- Returns:
- the fee amount in hbar
-
setHbarAmount
Assign the fee amount in hbar.- Parameters:
amount- the fee amount in hbar- Returns:
this
-
getDenominatingTokenId
Extract the token id.- Returns:
- the token id object
-
setDenominatingTokenId
Assign the desired token id.- Parameters:
tokenId- the token id- Returns:
this
-
setDenominatingTokenToSameToken
Assign the default token 0.0.0.- Returns:
this
-
validateChecksums
Description copied from class:CustomFeeVerify the validity of the client object.- Overrides:
validateChecksumsin classCustomFee- Parameters:
client- the configured client- Throws:
BadEntityIdException- if entity ID is formatted poorly
-
toString
-
toFixedFeeProtobuf
FixedFee toFixedFeeProtobuf()Convert to a protobuf.- Returns:
- the protobuf converted object
-
toProtobuf
CustomFee toProtobuf()Description copied from class:CustomFeeCreate the protobuf.- Specified by:
toProtobufin classCustomFee- Returns:
- the protobuf for the custom fee object
-