public class StateSumming
Modifier and Type | Method and Description |
---|---|
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,
AbstractParty 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 <T> Amount<net.corda.core.contracts.Issued> |
sumFungibleOrNull(java.lang.Iterable<? extends net.corda.core.contracts.ContractState> $receiver)
Sums the asset states in the list, returning null if there are none.
|
static <T> Amount<net.corda.core.contracts.Issued> |
sumFungibleOrZero(java.lang.Iterable<? extends net.corda.core.contracts.ContractState> $receiver,
Issued<? extends T> token)
Sums the asset states in the list, returning zero of the given token if there are none.
|
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.finance.contracts.asset.Obligation.Terms> issuanceDef)
Sums the obligation states in the list, returning zero of the given product if there are none.
|
public static Amount<net.corda.core.contracts.Issued> sumCashBy(java.lang.Iterable<? extends net.corda.core.contracts.ContractState> $receiver, AbstractParty 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).
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).
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.
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.
public static <T> Amount<net.corda.core.contracts.Issued> sumFungibleOrNull(java.lang.Iterable<? extends net.corda.core.contracts.ContractState> $receiver)
Sums the asset states in the list, returning null if there are none.
public static <T> Amount<net.corda.core.contracts.Issued> sumFungibleOrZero(java.lang.Iterable<? extends net.corda.core.contracts.ContractState> $receiver, Issued<? extends T> token)
Sums the asset states in the list, returning zero of the given token if there are none.
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.
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.
public static <P> Amount<net.corda.core.contracts.Issued> sumObligationsOrZero(java.lang.Iterable<? extends net.corda.core.contracts.ContractState> $receiver, Issued<net.corda.finance.contracts.asset.Obligation.Terms> issuanceDef)
Sums the obligation states in the list, returning zero of the given product if there are none.