corda / net.corda.core.contracts / Amount / sumOrZero

sumOrZero

@JvmStatic fun <T : Any> Iterable<Amount<T>>.sumOrZero(token: T): Amount<T>

If the given iterable of Amounts yields any elements, sum them, throwing an IllegalArgumentException if any of the token types are mismatched; if the iterator yields no elements, return a zero amount of the given token type.