Dumper
@UnstableApi
public final class Dumper
Helper utility to dump field values.
Summary
Nested types |
|---|
public interface Dumper.DumpableProvides custom dump method. |
Public constructors |
|---|
Dumper() |
Public methods |
|
|---|---|
Dumper |
@CanIgnoreReturnValue |
Dumper |
@CanIgnoreReturnValue |
Dumper |
@CanIgnoreReturnValue |
Dumper |
@CanIgnoreReturnValueCalls |
Dumper |
@CanIgnoreReturnValueApplies |
Dumper |
@CanIgnoreReturnValue |
Dumper |
|
Dumper |
|
String |
toString() |
Public constructors
Public methods
addIfNonDefault
@CanIgnoreReturnValue
public Dumper addIfNonDefault(
String field,
@Nullable Object value,
@Nullable Object defaultValue
)
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
public Dumper <T> addIfNonDefault(
String field,
T value,
T defaultValue,
Function<T, Object> valueTransformFunction
)
Applies valueTransformFunction to value and defaultValue and passes the results to addIfNonDefault.
See addIfNonDefault for limitations around when null results from valueTransformFunction are permitted.