Dumper
@UnstableApi
class Dumper
Helper utility to dump field values.
Summary
Nested types |
|---|
interface Dumper.DumpableProvides custom dump method. |
Public constructors |
|---|
Dumper() |
Public functions |
|
|---|---|
Dumper! |
@CanIgnoreReturnValue |
Dumper! |
@CanIgnoreReturnValue |
Dumper! |
@CanIgnoreReturnValue |
Dumper! |
@CanIgnoreReturnValueCalls |
Dumper! |
@CanIgnoreReturnValueApplies |
Dumper! |
@CanIgnoreReturnValue |
Dumper! |
|
Dumper! |
@CanIgnoreReturnValue |
String! |
toString() |
Public constructors
Public functions
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 NullPointerException.
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.