corda / net.corda.core

Package net.corda.core

Types

ErrorOr data class ErrorOr<out A>

Representation of an operation that may have thrown an error.

ThreadBox class ThreadBox<out T>

A threadbox is a simple utility that makes it harder to forget to take a lock before accessing some shared state. Simply define a private class to hold the data that must be grouped under the same lock, and then pass the only instance to the ThreadBox constructor. You can now use the locked method with a lambda to take the lock in a way that ensures it'll be released if there's an exception.

TransientProperty class TransientProperty<out T>

A simple wrapper that enables the use of Kotlin's "val x by TransientProperty { ... }" syntax. Such a property will not be serialized to disk, and if it's missing (or the first time it's accessed), the initializer will be used to set it up. Note that the initializer will be called with the TransientProperty object locked.

Exceptions

RetryableException abstract class RetryableException : Exception

This represents a transient exception or condition that might no longer be thrown if the operation is re-run or called again.

Extensions for External Classes

com.google.common.util.concurrent.ListenableFuture
com.google.common.util.concurrent.SettableFuture
java.io.InputStream
java.nio.file.Path
java.time.temporal.Temporal
java.util.concurrent.Future
kotlin.Double
kotlin.Int
kotlin.Long
kotlin.String
kotlin.Throwable
kotlin.collections.Iterable
kotlin.collections.List
org.slf4j.Logger
rx.Observable
rx.Observer

Properties

RunOnCallerThread val RunOnCallerThread: Executor

Functions

codePointsString fun codePointsString(vararg codePoints: Int): String
elapsedTime fun elapsedTime(block: () -> Unit): Duration
extractZipFile fun extractZipFile(zipFile: Path, toDirectory: Path): Unit

Given a path to a zip file, extracts it to the given directory.

future fun <T> future(block: () -> T): ListenableFuture<T>
logElapsedTime fun <T> logElapsedTime(label: String, logger: Logger? = null, body: () -> T): T
random63BitValue fun random63BitValue(): Long

Returns a random positive long generated using a secure RNG. This function sacrifies a bit of entropy in order to avoid potential bugs where the value is used in a context where negative numbers are not expected.