public static class AmountTransfer.Companion
Modifier and Type | Method and Description |
---|---|
<T,P> AmountTransfer<T,P> |
fromDecimal(java.math.BigDecimal displayQuantityDelta,
T token,
P source,
P destination,
java.math.RoundingMode rounding)
Construct an AmountTransfer object from an indicative/displayable BigDecimal source, applying rounding as specified.
The token size is determined from the token type and is the same as for
class Amount of the same token. |
<T,P> AmountTransfer<T,P> |
zero(T token,
P source,
P destination)
Helper to make a zero size AmountTransfer.
|
public <T,P> AmountTransfer<T,P> fromDecimal(java.math.BigDecimal displayQuantityDelta, T token, P source, P destination, java.math.RoundingMode rounding)
Construct an AmountTransfer object from an indicative/displayable BigDecimal source, applying rounding as specified.
The token size is determined from the token type and is the same as for class Amount
of the same token.
displayQuantityDelta
- is the signed amount to transfer between source and destination in displayable units.
Positive values mean transfers from source to destination. Negative values mean transfers from destination to source.token
- defines the asset being represented in the transfer. The token should implement interface TokenizableAssetInfo
if custom
conversion logic is required.source
- The payer of the transfer if displayQuantityDelta is positive, the payee if displayQuantityDelta is negativedestination
- The payee of the transfer if displayQuantityDelta is positive, the payer if displayQuantityDelta is negativerounding
- The mode of rounding to apply after scaling to integer token units.class Amount
public <T,P> AmountTransfer<T,P> zero(T token, P source, P destination)
Helper to make a zero size AmountTransfer.