Package net.corda.v5.base.util

Types

Link copied to clipboard
open class Base58
Base58 is a way to encode Bitcoin addresses (or arbitrary data) as alphanumeric strings.

Functions

Link copied to clipboard
fun String.base58toBase64(): String

Encoding changer. Base58-String to Base64-String, i.e. "SGVsbG8gV29ybGQ=" -> JxF12TrwUP45BMd"

Link copied to clipboard
fun String.base58ToByteArray(): ByteArray
Link copied to clipboard
fun String.base58toHex(): String

Encoding changer. Base58-String to Hex-String, i.e. "SGVsbG8gV29ybGQ=" -> "48656C6C6F20576F726C64"

Link copied to clipboard
fun String.base58ToRealString(): String

Base58-String to the actual real String, i.e. "JxF12TrwUP45BMd" -> "Hello World".

Link copied to clipboard
fun String.base64toBase58(): String

Encoding changer. Base64-String to Base58-String, i.e. "SGVsbG8gV29ybGQ=" -> JxF12TrwUP45BMd"

Link copied to clipboard
fun String.base64ToByteArray(): ByteArray
Link copied to clipboard
fun String.base64toHex(): String

Encoding changer. Base64-String to Hex-String, i.e. "SGVsbG8gV29ybGQ=" -> "48656C6C6F20576F726C64"

Link copied to clipboard
fun String.base64ToRealString(): String

Base64-String to the actual real String, i.e. "SGVsbG8gV29ybGQ=" -> "Hello World".

Link copied to clipboard
fun Any.contextLogger(): Logger

When called from a companion object, returns the logger for the enclosing class.

Link copied to clipboard
inline fun Logger.debug(msg: () -> String)

Log a DEBUG level message produced by evaluating the given lamdba, but only if DEBUG logging is enabled.

Link copied to clipboard
fun detailedLogger(): Logger

Returns the logger used for detailed logging.

Link copied to clipboard
infix fun Int.exactAdd(b: Int): Int
infix fun Long.exactAdd(b: Long): Long

Like the + operator but throws ArithmeticException in case of integer overflow.

Link copied to clipboard
fun String.hexToBase58(): String

Encoding changer. Hex-String to Base58-String, i.e. "48656C6C6F20576F726C64" -> "JxF12TrwUP45BMd"

Link copied to clipboard
fun String.hexToBase64(): String

Encoding changer. Hex-String to Base64-String, i.e. "48656C6C6F20576F726C64" -> "SGVsbG8gV29ybGQ="

Link copied to clipboard
fun String.hexToByteArray(): ByteArray

Hex-String to ByteArray. Accept any hex form (capitalized, lowercase, mixed).

Link copied to clipboard
fun String.hexToRealString(): String

HEX-String to the actual real String, i.e. "48656C6C6F20576F726C64" -> "Hello World".

Link copied to clipboard
inline fun <T : Any> loggerFor(): Logger

Usually you won't need this method:

Link copied to clipboard
inline fun <T> LayeredPropertyMap.parse(key: String): T

Function for reading and parsing the String values stored in the values to actual objects.

Link copied to clipboard
inline fun <T> LayeredPropertyMap.parseList(itemKeyPrefix: String): List<T>

Function for reading and parsing the String values stored in the values to an actual list of objects.

Link copied to clipboard
inline fun <T> LayeredPropertyMap.parseOrNull(key: String): T?

Function for reading and parsing the String values stored in the values to actual objects or return null.

Link copied to clipboard
inline fun <T> LayeredPropertyMap.parseSet(itemKeyPrefix: String): Set<T>

Function for reading and parsing the String values stored in the values to an actual set of objects.

Link copied to clipboard
fun ByteArray.toBase58(): String

Convert a byte array to a Base58 encoded String.

Link copied to clipboard
fun ByteArray.toBase64(): String

Convert a byte array to a Base64 encoded String.

Link copied to clipboard
fun ByteArray.toHex(): String

Convert a byte array to a hex (Base16) capitalized encoded String.

Link copied to clipboard
inline fun Logger.trace(msg: () -> String)

Log a TRACE level message produced by evaluating the given lamdba, but only if TRACE logging is enabled.

Link copied to clipboard
fun <T, U : T> uncheckedCast(obj: T): U

Properties

Link copied to clipboard
val Int.days: Duration

Extension method for easier construction of Durations in terms of integer days: val twoDays = 2.days.

Link copied to clipboard
val Int.hours: Duration

Extension method for easier construction of Durations in terms of integer hours: val twoHours = 2.hours.

Link copied to clipboard
val Int.millis: Duration

Extension method for easier construction of Durations in terms of integer milliseconds: val twoMillis = 2.millis.

Link copied to clipboard
val Int.minutes: Duration

Extension method for easier construction of Durations in terms of integer minutes: val twoMinutes = 2.minutes.

Link copied to clipboard
val Int.seconds: Duration

Extension method for easier construction of Durations in terms of integer seconds: val twoSeconds = 2.seconds.