AmountTransfer.Companion
Keywords: net.corda.core.contracts.AmountTransfer.Companion class
Date: 2023-09-18

net.corda.core.contracts

## Class AmountTransfer.Companion

- net.corda.core.contracts.AmountTransfer.Companion

- Enclosing class:
    AmountTransfer<T,P>

      public static class AmountTransfer.Companion

- - ### Method Detail

    - #### fromDecimal

          @JvmStatic
           @JvmOverloads
           @NotNull
          public <T,P> AmountTransfer<T,P> fromDecimal(@NotNull
                                                                                           java.math.BigDecimal displayQuantityDelta,
                                                                                           @NotNull
                                                                                           T token,
                                                                                           @NotNull
                                                                                           P source,
                                                                                           @NotNull
                                                                                           P destination,
                                                                                           @NotNull
                                                                                           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.

      Parameters:
        `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 customconversion logic is required.
        `source` - The payer of the transfer if displayQuantityDelta is positive, the payee if displayQuantityDelta is negative
        `destination` - The payee of the transfer if displayQuantityDelta is positive, the payer if displayQuantityDelta is negative
        `rounding` - The mode of rounding to apply after scaling to integer token units.
      See Also:
        `class Amount`

    - #### fromDecimal

          @JvmStatic
           @JvmOverloads
           @NotNull
          public <T,P> AmountTransfer<T,P> fromDecimal(@NotNull
                                                                                           java.math.BigDecimal displayQuantityDelta,
                                                                                           @NotNull
                                                                                           T token,
                                                                                           @NotNull
                                                                                           P source,
                                                                                           @NotNull
                                                                                           P destination)

      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.

      Parameters:
        `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 customconversion logic is required.
        `source` - The payer of the transfer if displayQuantityDelta is positive, the payee if displayQuantityDelta is negative
        `destination` - The payee of the transfer if displayQuantityDelta is positive, the payer if displayQuantityDelta is negative
      See Also:
        `class Amount`

    - #### zero

          @JvmStatic
           @NotNull
          public <T,P> AmountTransfer<T,P> zero(@NotNull
                                                                     T token,
                                                                     @NotNull
                                                                     P source,
                                                                     @NotNull
                                                                     P destination)

      Helper to make a zero size AmountTransfer.