NonEmptySet

class NonEmptySet<T> : Set<T>

An immutable ordered non-empty set.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val size: Int

Functions

Link copied to clipboard
fun Iterable<TransactionSignature>.byKeys(): <Error class: unknown class>

Returns the set of all PublicKeys of the signatures.

Link copied to clipboard
open operator override fun contains(element: T): Boolean
Link copied to clipboard
open override fun containsAll(elements: Collection<T>): Boolean
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
Link copied to clipboard

Filters a list of StateAndRef objects according to the type of the states

Link copied to clipboard
inline fun <T, R> Collection<T>.flatMapToSet(transform: (T) -> Iterable<R>): Set<R>

Similar to Iterable.flatMap except it maps to a Set which preserves the iteration order.

Link copied to clipboard
open override fun forEach(action: Consumer<in T>)
Link copied to clipboard
inline fun <K, V> Iterable<V>.groupByMultipleKeys(keysSelector: (V) -> Iterable<K>, onDuplicate: (K, V, V) -> Unit = { key, value1, value2 -> throw IllegalArgumentException("Duplicate mapping for $key ($value1, $value2)") }): Map<K, V>

Map the elements of the Iterable to multiple keys. By default duplicate mappings are not allowed. The returned Map preserves the iteration order of the values.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun head(): T

Returns the first element of the set.

Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
open operator override fun iterator(): Iterator<T>
Link copied to clipboard
inline fun <T, R> Collection<T>.mapToSet(transform: (T) -> R): Set<R>

Similar to Iterable.map except it maps to a Set which preserves the iteration order.

Link copied to clipboard
inline fun <T> Iterable<T>.noneOrSingle(predicate: (T) -> Boolean): T?

Returns the single element matching the given predicate, or null if the collection is empty, or throws exception if more than one element was found.

Link copied to clipboard
open override fun parallelStream(): Stream<T>
Link copied to clipboard

Ensures that a transaction has only one command that is of the given type, otherwise throws an exception.

Link copied to clipboard
inline fun <T : CommandData> Collection<CommandWithParties<CommandData>>.select(signer: PublicKey? = null, party: AbstractParty? = null): <Error class: unknown class>
fun <C : CommandData> Collection<CommandWithParties<CommandData>>.select(klass: Class<C>, signer: PublicKey? = null, party: AbstractParty? = null): <Error class: unknown class>

Filters the command list by type, party and public key all at once.

inline fun <T : CommandData> Collection<CommandWithParties<CommandData>>.select(signers: Collection<PublicKey>?, parties: Collection<Party>?): <Error class: unknown class>
fun <C : CommandData> Collection<CommandWithParties<CommandData>>.select(klass: Class<C>, signers: Collection<PublicKey>?, parties: Collection<Party>?): <Error class: unknown class>

Filters the command list by type, parties and public keys all at once.

Link copied to clipboard
open override fun spliterator(): Spliterator<T>
Link copied to clipboard
open override fun stream(): Stream<T>
Link copied to clipboard

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).

Link copied to clipboard

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).

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

Sums the asset states in the list, returning zero of the given token if there are none.

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

Sums the obligation states in the list, returning zero of the given product if there are none.

Link copied to clipboard

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.

Link copied to clipboard
fun <T : Any> Iterable<Amount<T>>.sumOrThrow(): <Error class: unknown class>

Sums the amounts yielded by the given iterable, throwing an IllegalArgumentException if any of the token types are mismatched.

Link copied to clipboard
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.

Link copied to clipboard
open fun <T : Any> toArray(p0: IntFunction<Array<T>>): Array<T>
Link copied to clipboard
fun <K, V> Iterable<<Error class: unknown class><K, V>>.toMultiMap(): Map<K, List<V>>
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

If all of the given futures succeed, the returned future's outcome is a list of all their values. The values are in the same order as the futures in the collection, not the order of completion. If at least one given future fails, the returned future's outcome is the first throwable that was thrown. Any subsequent throwables are added to the first one as suppressed throwables, in the order they are thrown. If no futures were given, the returned future has an immediate outcome of empty list. Otherwise the returned future does not have an outcome until all given futures have an outcome. Unlike Guava's Futures.allAsList, this method never hides failures/hangs subsequent to the first failure.