net.corda.contracts.asset

## Class CashKt

- net.corda.contracts.asset.CashKt

-     public class CashKt

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Cash.State` | `getCASH(Amount<java.util.Currency> $receiver)` An extension property that lets you write 100.DOLLARS.CASH
    `static Cash` | `getCASH_PROGRAM_ID()`
    `static PartyAndReference` | `getDUMMY_CASH_ISSUER()` A dummy, randomly generated issuer party by the name of "Snake Oil Issuer"
    `static java.security.KeyPair` | `getDUMMY_CASH_ISSUER_KEY()` A randomly generated key.
    `static Cash.State` | `getSTATE(Amount<net.corda.core.contracts.Issued> $receiver)` An extension property that lets you get a cash state from an issued token, under the `class NullPublicKey`
    `static Cash.State` | `issued by(Cash.State $receiver, AbstractParty party)`
    `static Cash.State` | `issued by(Cash.State $receiver, PartyAndReference deposit)`
    `static Cash.State` | `issuedBy(Cash.State $receiver, AbstractParty party)`
    `static Cash.State` | `issuedBy(Cash.State $receiver, PartyAndReference deposit)`
    `static Cash.State` | `owned by(Cash.State $receiver, CompositeKey owner)`
    `static Cash.State` | `ownedBy(Cash.State $receiver, CompositeKey owner)`
    `static Amount<net.corda.core.contracts.Issued>` | `sumCash(java.lang.Iterable<? extends net.corda.core.contracts.ContractState> $receiver)` Sums the cash states in the list, throwing an exception if there are none, or if any of the cash states cannot be added together (i.e. are different currencies or issuers).
    `static Amount<net.corda.core.contracts.Issued>` | `sumCashBy(java.lang.Iterable<? extends net.corda.core.contracts.ContractState> $receiver, CompositeKey owner)` Sums the cash states in the list belonging to a single owner, throwing an exception if there are none, or if any of the cash states cannot be added together (i.e. are different currencies or issuers).
    `static Amount<net.corda.core.contracts.Issued>` | `sumCashOrNull(java.lang.Iterable<? extends net.corda.core.contracts.ContractState> $receiver)` Sums the cash states in the list, returning null if there are none.
    `static Amount<net.corda.core.contracts.Issued>` | `sumCashOrZero(java.lang.Iterable<? extends net.corda.core.contracts.ContractState> $receiver, Issued<java.util.Currency> currency)` Sums the cash states in the list, returning zero of the given currency+issuer if there are none.
    `static Cash.State` | `with deposit(Cash.State $receiver, PartyAndReference deposit)`
    `static Cash.State` | `withDeposit(Cash.State $receiver, PartyAndReference deposit)`

- - ### Method Detail

    - #### getCASH_PROGRAM_ID

          public static Cash getCASH_PROGRAM_ID()

    - #### sumCashBy

          public static Amount<net.corda.core.contracts.Issued> sumCashBy(java.lang.Iterable<? extends net.corda.core.contracts.ContractState> $receiver,
                                                                          CompositeKey owner)

      Sums the cash states in the list belonging to a single owner, throwing an exception if there are none, or if any of the cash states cannot be added together (i.e. are different currencies or issuers).

    - #### sumCash

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

      Sums the cash states in the list, throwing an exception if there are none, or if any of the cash states cannot be added together (i.e. are different currencies or issuers).

    - #### sumCashOrNull

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

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

    - #### sumCashOrZero

          public static Amount<net.corda.core.contracts.Issued> sumCashOrZero(java.lang.Iterable<? extends net.corda.core.contracts.ContractState> $receiver,
                                                                              Issued<java.util.Currency> currency)

      Sums the cash states in the list, returning zero of the given currency+issuer if there are none.

    - #### ownedBy

          public static Cash.State ownedBy(Cash.State $receiver,
                                           CompositeKey owner)

    - #### issuedBy

          public static Cash.State issuedBy(Cash.State $receiver,
                                            AbstractParty party)

    - #### issuedBy

          public static Cash.State issuedBy(Cash.State $receiver,
                                            PartyAndReference deposit)

    - #### withDeposit

          public static Cash.State withDeposit(Cash.State $receiver,
                                               PartyAndReference deposit)

    - #### owned by

          public static Cash.State owned by(Cash.State $receiver,
                                            CompositeKey owner)

    - #### issued by

          public static Cash.State issued by(Cash.State $receiver,
                                             AbstractParty party)

    - #### issued by

          public static Cash.State issued by(Cash.State $receiver,
                                             PartyAndReference deposit)

    - #### with deposit

          public static Cash.State with deposit(Cash.State $receiver,
                                                PartyAndReference deposit)

    - #### getDUMMY_CASH_ISSUER_KEY

          public static java.security.KeyPair getDUMMY_CASH_ISSUER_KEY()

      A randomly generated key.

    - #### getDUMMY_CASH_ISSUER

          public static PartyAndReference getDUMMY_CASH_ISSUER()

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

    - #### getCASH

          public static Cash.State getCASH(Amount<java.util.Currency> $receiver)

      An extension property that lets you write 100.DOLLARS.CASH

    - #### getSTATE

          public static Cash.State getSTATE(Amount<net.corda.core.contracts.Issued> $receiver)

      An extension property that lets you get a cash state from an issued token, under the `class NullPublicKey`

      See Also:
        `class NullPublicKey`