corda / net.corda.core.transactions / LedgerTransaction / filterReferenceInputs

filterReferenceInputs

fun <T : ContractState> filterReferenceInputs(clazz: Class<T>, predicate: Predicate<T>): List<T>

Helper to simplify filtering reference inputs according to a Predicate.

Parameters

clazz - The class type used for filtering via an Class.isInstance check. clazz must be an extension of ContractState.

predicate - A filtering function taking a state of type T and returning true if it should be included in the list. The class filtering is applied before the predicate.

Return
the possibly empty list of reference states matching the predicate and clazz restrictions.

inline fun <reified T : ContractState> filterReferenceInputs(crossinline predicate: (T) -> Boolean): List<T>