corda / net.corda.core.utilities

Package net.corda.core.utilities

Types

ByteSequence

An abstraction of a byte array, with offset and size that does no copying of bytes unless asked to.

sealed class ByteSequence : Comparable<ByteSequence>

Id

Represents a unique, timestamped id.

open class Id<out VALUE : Any>

NetworkHostAndPort

Tuple of host and port. Use NetworkHostAndPort.parse on untrusted data.

data class NetworkHostAndPort

NonEmptySet

An immutable ordered non-empty set.

class NonEmptySet<T> : Set<T>

OpaqueBytes

A simple class that wraps a byte array and makes the equals/hashCode/toString methods work as you actually expect. In an ideal JVM this would be a value type and be completely overhead free. Project Valhalla is adding such functionality to Java, but it won't arrive for a few years yet!

open class OpaqueBytes : ByteSequence

OpaqueBytesSubSequence

Class is public for serialization purposes.

class OpaqueBytesSubSequence : ByteSequence

ProgressTracker

A progress tracker helps surface information about the progress of an operation to a user interface or API of some kind. It lets you define a set of steps that represent an operation. A step is represented by an object (typically a singleton).

class ProgressTracker

PropertyDelegate

Simple interface encapsulating the implicit Kotlin contract for immutable property delegates.

interface PropertyDelegate<out T>

SgxSupport

object SgxSupport

Try

Representation of an operation that has either succeeded with a result (represented by Success) or failed with an exception (represented by Failure).

sealed class Try<out A>

UntrustworthyData

A small utility to approximate taint tracking: if a method gives you back one of these, it means the data came from a remote source that may be incentivised to pass us junk that violates basic assumptions and thus must be checked first. The wrapper helps you to avoid forgetting this vital step. Things you might want to check are:

class UntrustworthyData<out T>

UuidGenerator

class UuidGenerator

VariablePropertyDelegate

Simple interface encapsulating the implicit Kotlin contract for mutable property delegates.

interface VariablePropertyDelegate<T> : PropertyDelegate<T>

Extensions for External Classes

java.lang.management.ThreadInfo

java.security.PublicKey

java.util.concurrent.Future

kotlin.Any

kotlin.ByteArray

kotlin.collections.Collection

kotlin.Int

kotlin.Long

kotlin.String

org.slf4j.Logger

Properties

MAX_HASH_HEX_SIZE

The maximum supported field-size for hash HEX-encoded outputs (e.g. database fields). This value is enough to support hash functions with outputs up to 512 bits (e.g. SHA3-512), in which case 128 HEX characters are required. 130 was selected instead of 128, to allow for 2 extra characters that will be used as hash-scheme identifiers.

const val MAX_HASH_HEX_SIZE: Int

Functions

detailedLogger

Returns the logger used for detailed logging.

fun detailedLogger(): Logger

loggerFor

Usually you won't need this method:

fun <T : Any> loggerFor(): Logger

parsePublicKeyBase58

Method to return the PublicKey object given its Base58-String representation.

fun parsePublicKeyBase58(base58String: String): PublicKey

threadDumpAsString

fun threadDumpAsString(): String

transient

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

fun <T> transient(initializer: () -> T): PropertyDelegate<T>

unwrap

fun <T, R> UntrustworthyData<T>.unwrap(validator: (T) -> R): R