@Override com.google.logging.v2.LogEntry.Builder toPb() { return com.google.logging.v2.LogEntry.newBuilder().setJsonPayload(getData()); }
/** Returns the log entry's JSON data as an unmodifiable map. */ public Map<String, Object> getDataAsMap() { return Structs.asMap(getData()); }
@Test public void testOf() { assertEquals(Type.STRING, STRING_PAYLOAD.getType()); assertEquals(STRING_DATA, STRING_PAYLOAD.getData()); assertEquals(Type.JSON, JSON_PAYLOAD.getType()); assertEquals(STRUCT_DATA, JSON_PAYLOAD.getData()); assertEquals(JSON_DATA, JSON_PAYLOAD.getDataAsMap()); assertEquals(Type.PROTO, PROTO_PAYLOAD.getType()); assertEquals(PROTO_DATA, PROTO_PAYLOAD.getData()); JsonPayload jsonPayload = JsonPayload.of(STRUCT_DATA); assertEquals(Type.JSON, jsonPayload.getType()); assertEquals(STRUCT_DATA, jsonPayload.getData()); assertEquals(JSON_DATA, jsonPayload.getDataAsMap()); }
@Override com.google.logging.v2.LogEntry.Builder toPb() { return com.google.logging.v2.LogEntry.newBuilder().setJsonPayload(getData()); }
/** Returns the log entry's JSON data as an unmodifiable map. */ public Map<String, Object> getDataAsMap() { return Structs.asMap(getData()); }