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

net.corda.core.contracts

## Class SourceAndAmount<T,P>

- net.corda.core.contracts.SourceAndAmount<T,P>

- Type Parameters:
    `T` -

    The token type of the underlying `class Amount`.

    `P` -

    Any class type that can disambiguate where the amount came from.

      public class SourceAndAmount<T,P>

  Simple data class to associate the origin, owner, or holder of a particular Amount object.

- - ### Constructor Detail

    - #### SourceAndAmount

          public SourceAndAmount(@NotNull
                                 P source,
                                 @NotNull
                                 Amount<T> amount,
                                 @Nullable
                                 java.lang.Object ref)

      Simple data class to associate the origin, owner, or holder of a particular Amount object.

      Parameters:
        `source` - the holder of the Amount.
        `amount` - the Amount of asset available.
        `ref` - is an optional field used for housekeeping in the caller.e.g. to point back at the original Vault state objects.

  - ### Method Detail

    - #### getSource

          @NotNull
          public P getSource()

      the holder of the Amount.

    - #### getAmount

          @NotNull
          public Amount<T> getAmount()

      the Amount of asset available.

    - #### getRef

          @Nullable
          public java.lang.Object getRef()

      is an optional field used for housekeeping in the caller.

      e.g. to point back at the original Vault state objects.

      See Also:
        SourceAndAmount.apply

    - #### component1

          @NotNull
          public P component1()

      the holder of the Amount.

    - #### component2

          @NotNull
          public Amount<T> component2()

      the Amount of asset available.

    - #### component3

          @Nullable
          public java.lang.Object component3()

      is an optional field used for housekeeping in the caller.

      e.g. to point back at the original Vault state objects.

      See Also:
        SourceAndAmount.apply

    - #### copy

          @NotNull
          public SourceAndAmount<T,P> copy(@NotNull
                                                    P source,
                                                    @NotNull
                                                    Amount<T> amount,
                                                    @Nullable
                                                    java.lang.Object ref)

      Simple data class to associate the origin, owner, or holder of a particular Amount object.

    - #### toString

          @NotNull
          public java.lang.String toString()

      Simple data class to associate the origin, owner, or holder of a particular Amount object.

    - #### hashCode

          public int hashCode()

      Simple data class to associate the origin, owner, or holder of a particular Amount object.

    - #### equals

          public boolean equals(@Nullable
                                java.lang.Object p)

      Simple data class to associate the origin, owner, or holder of a particular Amount object.