Class Payload.JsonPayload (3.5.3)

public static final class Payload.JsonPayload extends Payload<Struct>

A log entry's JSON payload.

Inheritance

java.lang.Object > Payload > Payload.JsonPayload

Methods

getDataAsMap()

public Map<String,Object> getDataAsMap()

Returns the log entry's JSON data as an unmodifiable map.

Returns
TypeDescription
Map<String,Object>

of(Struct data)

public static Payload.JsonPayload of(Struct data)

Creates a log entry payload given its JSON data represented as a protobuf struct.

Parameter
NameDescription
dataStruct
Returns
TypeDescription
Payload.JsonPayload

of(Map<String,?> data)

public static Payload.JsonPayload of(Map<String,?> data)

Creates a log entry payload given its JSON data represented as a map. The provided map is copied into a Struct object.

Notice that all numbers (int, long, float and double) are serialized as double values. Enums are serialized as strings.

Example usage of JsonPayload:


 List<Long> listValue = Arrays.asList(1L, 2L);
 Map
Parameter
NameDescription
dataMap<String,?>
Returns
TypeDescription
Payload.JsonPayload