net.corda.contracts.asset

## Class ObligationKt

- net.corda.contracts.asset.ObligationKt

-     public class ObligationKt

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T> Obligation.State<T>` | `at(Obligation.State<T> $receiver, java.time.Instant dueBefore)`
    `static <T> Obligation.State<T>` | `between(Obligation.State<T> $receiver, kotlin.Pair<? extends net.corda.core.crypto.AbstractParty,? extends net.corda.core.crypto.CompositeKey> parties)`
    `static <P> java.util.Map<kotlin.Pair,net.corda.core.contracts.Amount>` | `extractAmountsDue(Obligation.Terms<P> product, java.lang.Iterable<net.corda.contracts.asset.Obligation.State> states)` Convert a list of settlement states into total from each obligor to a beneficiary.
    `static Party` | `getDUMMY_OBLIGATION_ISSUER()` A dummy, randomly generated issuer party by the name of "Snake Oil Issuer"
    `static java.security.KeyPair` | `getDUMMY_OBLIGATION_ISSUER_KEY()` A randomly generated key.
    `static Obligation.State<java.util.Currency>` | `getOBLIGATION(Amount<net.corda.core.contracts.Issued> $receiver)`
    `static Obligation.Terms<java.util.Currency>` | `getOBLIGATION_DEF(Issued<java.util.Currency> $receiver)`
    `static Obligation<java.util.Currency>` | `getOBLIGATION_PROGRAM_ID()`
    `static <T> Obligation.State<T>` | `issued by(Obligation.State<T> $receiver, AbstractParty party)`
    `static <T> Obligation.State<T>` | `issuedBy(Obligation.State<T> $receiver, AnonymousParty party)`
    `static <P> java.util.Map<kotlin.Pair,net.corda.core.contracts.Amount>` | `netAmountsDue(java.util.Map<kotlin.Pair,net.corda.core.contracts.Amount> balances)` Net off the amounts due between parties.
    `static <T> Obligation.State<T>` | `owned by(Obligation.State<T> $receiver, CompositeKey owner)`
    `static <T> Obligation.State<T>` | `ownedBy(Obligation.State<T> $receiver, CompositeKey owner)`
    `static <P> java.util.Map<net.corda.core.crypto.CompositeKey,java.lang.Long>` | `sumAmountsDue(java.util.Map<kotlin.Pair,net.corda.core.contracts.Amount> balances)` Calculate the total balance movement for each party in the transaction, based off a summary of balances between each obligor and beneficiary.
    `static <P> Amount<net.corda.core.contracts.Issued>` | `sumObligations(java.lang.Iterable<? extends net.corda.core.contracts.ContractState> $receiver)` Sums the obligation states in the list, throwing an exception if there are none. All state objects in the list are presumed to be nettable.
    `static <P> Amount<net.corda.core.contracts.Issued>` | `sumObligationsOrNull(java.lang.Iterable<? extends net.corda.core.contracts.ContractState> $receiver)` Sums the obligation states in the list, returning null if there are none.
    `static <P> Amount<net.corda.core.contracts.Issued>` | `sumObligationsOrZero(java.lang.Iterable<? extends net.corda.core.contracts.ContractState> $receiver, Issued<net.corda.contracts.asset.Obligation.Terms> issuanceDef)` Sums the obligation states in the list, returning zero of the given product if there are none.

- - ### Method Detail

    - #### getOBLIGATION_PROGRAM_ID

          public static Obligation<java.util.Currency> getOBLIGATION_PROGRAM_ID()

    - #### extractAmountsDue

          public static <P> java.util.Map<kotlin.Pair,net.corda.core.contracts.Amount> extractAmountsDue(Obligation.Terms<P> product,
                                                                                                         java.lang.Iterable<net.corda.contracts.asset.Obligation.State> states)

      Convert a list of settlement states into total from each obligor to a beneficiary.

      Returns:
        a map of obligor/beneficiary pairs to the balance due.

    - #### netAmountsDue

          public static <P> java.util.Map<kotlin.Pair,net.corda.core.contracts.Amount> netAmountsDue(java.util.Map<kotlin.Pair,net.corda.core.contracts.Amount> balances)

      Net off the amounts due between parties.

    - #### sumAmountsDue

          public static <P> java.util.Map<net.corda.core.crypto.CompositeKey,java.lang.Long> sumAmountsDue(java.util.Map<kotlin.Pair,net.corda.core.contracts.Amount> balances)

      Calculate the total balance movement for each party in the transaction, based off a summary of balances between each obligor and beneficiary.

      Parameters:
        `balances` - payments due, indexed by obligor and beneficiary. Zero balances are stripped from the map before being returned.

    - #### sumObligations

          public static <P> Amount<net.corda.core.contracts.Issued> sumObligations(java.lang.Iterable<? extends net.corda.core.contracts.ContractState> $receiver)

      Sums the obligation states in the list, throwing an exception if there are none. All state objects in the list are presumed to be nettable.

    - #### sumObligationsOrNull

          public static <P> Amount<net.corda.core.contracts.Issued> sumObligationsOrNull(java.lang.Iterable<? extends net.corda.core.contracts.ContractState> $receiver)

      Sums the obligation states in the list, returning null if there are none.

    - #### sumObligationsOrZero

          public static <P> Amount<net.corda.core.contracts.Issued> sumObligationsOrZero(java.lang.Iterable<? extends net.corda.core.contracts.ContractState> $receiver,
                                                                                         Issued<net.corda.contracts.asset.Obligation.Terms> issuanceDef)

      Sums the obligation states in the list, returning zero of the given product if there are none.

    - #### at

          public static <T> Obligation.State<T> at(Obligation.State<T> $receiver,
                                                   java.time.Instant dueBefore)

    - #### between

          public static <T> Obligation.State<T> between(Obligation.State<T> $receiver,
                                                        kotlin.Pair<? extends net.corda.core.crypto.AbstractParty,? extends net.corda.core.crypto.CompositeKey> parties)

    - #### owned by

          public static <T> Obligation.State<T> owned by(Obligation.State<T> $receiver,
                                                         CompositeKey owner)

    - #### issued by

          public static <T> Obligation.State<T> issued by(Obligation.State<T> $receiver,
                                                          AbstractParty party)

    - #### ownedBy

          public static <T> Obligation.State<T> ownedBy(Obligation.State<T> $receiver,
                                                        CompositeKey owner)

    - #### issuedBy

          public static <T> Obligation.State<T> issuedBy(Obligation.State<T> $receiver,
                                                         AnonymousParty party)

    - #### getDUMMY_OBLIGATION_ISSUER_KEY

          public static java.security.KeyPair getDUMMY_OBLIGATION_ISSUER_KEY()

      A randomly generated key.

    - #### getDUMMY_OBLIGATION_ISSUER

          public static Party getDUMMY_OBLIGATION_ISSUER()

      A dummy, randomly generated issuer party by the name of "Snake Oil Issuer"

    - #### getOBLIGATION_DEF

          public static Obligation.Terms<java.util.Currency> getOBLIGATION_DEF(Issued<java.util.Currency> $receiver)

    - #### getOBLIGATION

          public static Obligation.State<java.util.Currency> getOBLIGATION(Amount<net.corda.core.contracts.Issued> $receiver)