corda / net.corda.core.contracts / Amount / sumOrNull

sumOrNull

@JvmStatic fun <T : Any> Iterable<Amount<T>>.sumOrNull(): 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 null.