net.corda.node.utilities / JDBCHashSet

JDBCHashSet

class JDBCHashSet<K : Any> : AbstractJDBCHashSet<K, BlobSetTable>

A convenient JDBC table backed hash set with iteration order based on insertion order. See AbstractJDBCHashSet and AbstractJDBCHashMap for further implementation details.

In this subclass, elements are represented by Blobs of Kryo serialized forms of the element objects. If you can extend AbstractJDBCHashSet and implement less Kryo dependent element mappings then that is likely preferrable.





Types

BlobSetTable class BlobSetTable : JDBCHashedTable

Constructors

<init> JDBCHashSet(tableName: String, loadOnInit: Boolean = false)

A convenient JDBC table backed hash set with iteration order based on insertion order. See AbstractJDBCHashSet and AbstractJDBCHashMap for further implementation details.

Inherited Properties

innerMap val innerMap: AbstractJDBCHashMap<K, Unit, T>
size open val size: Int
table val table: T

Functions

addElementToInsert fun addElementToInsert(insert: <ERROR CLASS>, entry: K, finalizables: MutableList<() -> Unit>): Unit

Implementation should marshall the element to the insert statement.

elementFromRow fun elementFromRow(row: <ERROR CLASS>): K

Implementation should return the element object marshalled from the database table row.

Inherited Functions

clear open fun clear(): Unit
isEmpty open fun isEmpty(): Boolean
iterator open fun iterator(): MutableIterator<K>

Extension Functions

noneOrSingle fun <T> Iterable<T>.noneOrSingle(predicate: (T) -> Boolean): T?

Returns the single element matching the given predicate, or null if element was not found, or throws if more than one element was found.

fun <T> Iterable<T>.noneOrSingle(): T?

Returns single element, or null if element was not found, or throws if more than one element was found.