@UnstableApi
class Dumper


Helper utility to dump field values.

Summary

Nested types

interface Dumper.Dumpable

Provides custom dump method.

Public constructors

Public functions

Dumper!
Dumper!
@CanIgnoreReturnValue
add(field: String!, value: Any!)
Dumper!
Dumper!
@CanIgnoreReturnValue
addIfNonDefault(field: String!, value: Any?, defaultValue: Any?)

Calls add if value is not equal to defaultValue.

Dumper!
@CanIgnoreReturnValue
<T> addIfNonDefault(
    field: String!,
    value: T!,
    defaultValue: T!,
    valueTransformFunction: Function<T!, Any!>!
)

Applies valueTransformFunction to value and defaultValue and passes the results to addIfNonDefault.

Dumper!
Dumper!
Dumper!
String!

Public constructors

Dumper

Dumper()

Public functions

add

@CanIgnoreReturnValue
fun add(field: String!, value: Any!): Dumper!

add

@CanIgnoreReturnValue
fun add(field: String!, value: ByteArray!): Dumper!

addIfNonDefault

@CanIgnoreReturnValue
fun addIfNonDefault(field: String!, value: Any?, defaultValue: Any?): Dumper!

Calls add if value is not equal to defaultValue.

It is not permitted to pass a null value to add, so null is only permitted here as a default value. Passing value == null && defaultValue != null will result in a .

addIfNonDefault

@CanIgnoreReturnValue
fun <T> addIfNonDefault(
    field: String!,
    value: T!,
    defaultValue: T!,
    valueTransformFunction: Function<T!, Any!>!
): Dumper!

Applies valueTransformFunction to value and defaultValue and passes the results to addIfNonDefault.

See addIfNonDefault for limitations around when null results from valueTransformFunction are permitted.

addTime

@CanIgnoreReturnValue
fun addTime(field: String!, time: Long): Dumper!

endBlock

@CanIgnoreReturnValue
fun endBlock(): Dumper!

startBlock

@CanIgnoreReturnValue
fun startBlock(name: String!): Dumper!

toString

fun toString(): String!