java.lang.Object
com.hedera.hashgraph.sdk.CustomFee
com.hedera.hashgraph.sdk.CustomFeeBase<CustomFractionalFee>
com.hedera.hashgraph.sdk.CustomFractionalFee
Custom fractional 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) CustomFractionalFee(package private) static CustomFractionalFeefromProtobuf(FractionalFee fractionalFee) Create a custom fractional fee from a fee protobuf.Extract the assessment method inclusive / exclusive.longExtract the denominator.longgetMax()Extract the fee amount.longgetMin()Extract the minimum fee amount.longExtract the numerator.setAssessmentMethod(FeeAssessmentMethod assessmentMethod) Assign the assessment method inclusive / exclusive.setDenominator(long denominator) Assign the denominator can not be zero (0).setMax(long max) Assign the maximum fee amount.setMin(long min) Assign the minimum fee amount.setNumerator(long numerator) Assign the numerator.(package private) FractionalFeeConvert the fractional fee object to a protobuf.(package private) CustomFeeCreate the protobuf.toString()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, validateChecksums
-
Constructor Details
-
CustomFractionalFee
public CustomFractionalFee()Constructor.
-
-
Method Details
-
fromProtobuf
Create a custom fractional fee from a fee protobuf.- Parameters:
fractionalFee- the fractional fee protobuf- Returns:
- the new custom fractional fee object
-
deepCloneSubclass
CustomFractionalFee deepCloneSubclass()- Specified by:
deepCloneSubclassin classCustomFeeBase<CustomFractionalFee>
-
getNumerator
public long getNumerator()Extract the numerator.- Returns:
- the numerator
-
setNumerator
Assign the numerator.- Parameters:
numerator- the numerator- Returns:
this
-
getDenominator
public long getDenominator()Extract the denominator.- Returns:
- the denominator
-
setDenominator
Assign the denominator can not be zero (0).- Parameters:
denominator- the denominator- Returns:
this
-
getMin
public long getMin()Extract the minimum fee amount.- Returns:
- the minimum fee amount
-
setMin
Assign the minimum fee amount.- Parameters:
min- the fee amount- Returns:
this
-
getMax
public long getMax()Extract the fee amount.- Returns:
- the fee amount
-
setMax
Assign the maximum fee amount.- Parameters:
max- the fee amount- Returns:
this
-
getAssessmentMethod
Extract the assessment method inclusive / exclusive.- Returns:
- the assessment method inclusive / exclusive
-
setAssessmentMethod
Assign the assessment method inclusive / exclusive.If the assessment method field is set, the token's custom fee is charged to the sending account and the receiving account receives the full token transfer amount. If this field is set to false, the receiver pays for the token custom fees and gets the remaining token balance. INCLUSIVE(false) EXCLUSIVE(true) See Hedera Documentation
- Parameters:
assessmentMethod- inclusive / exclusive- Returns:
this
-
toString
-
toFractionalFeeProtobuf
FractionalFee toFractionalFeeProtobuf()Convert the fractional fee object to a protobuf.- Returns:
- the protobuf object
-
toProtobuf
CustomFee toProtobuf()Description copied from class:CustomFeeCreate the protobuf.- Specified by:
toProtobufin classCustomFee- Returns:
- the protobuf for the custom fee object
-