public class JsonToProtoMessage extends Object implements ToProtoConverter<Object>
| Modifier and Type | Field and Description |
|---|---|
static JsonToProtoMessage |
INSTANCE |
| Constructor and Description |
|---|
JsonToProtoMessage()
You can use
JsonToProtoMessage.INSTANCE instead |
| Modifier and Type | Method and Description |
|---|---|
static com.google.protobuf.DynamicMessage |
convertJsonToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema,
org.json.JSONObject json) |
static com.google.protobuf.DynamicMessage |
convertJsonToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema,
TableSchema tableSchema,
org.json.JSONObject json) |
static com.google.protobuf.DynamicMessage |
convertJsonToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema,
TableSchema tableSchema,
org.json.JSONObject json,
boolean ignoreUnknownFields) |
com.google.protobuf.DynamicMessage |
convertToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema,
org.json.JSONObject json)
Converts Json data to protocol buffer messages given the protocol buffer descriptor.
|
com.google.protobuf.DynamicMessage |
convertToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema,
TableSchema tableSchema,
org.json.JSONObject json)
Converts Json data to protocol buffer messages given the protocol buffer descriptor.
|
com.google.protobuf.DynamicMessage |
convertToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema,
TableSchema tableSchema,
org.json.JSONObject json,
boolean ignoreUnknownFields)
Converts Json data to protocol buffer messages given the protocol buffer descriptor.
|
com.google.protobuf.DynamicMessage |
convertToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema,
TableSchema tableSchema,
Object json,
boolean ignoreUnknownFields)
Converts input message to Protobuf
|
public static final JsonToProtoMessage INSTANCE
public JsonToProtoMessage()
JsonToProtoMessage.INSTANCE insteadpublic static com.google.protobuf.DynamicMessage convertJsonToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema,
TableSchema tableSchema,
org.json.JSONObject json,
boolean ignoreUnknownFields)
public static com.google.protobuf.DynamicMessage convertJsonToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema,
org.json.JSONObject json)
public static com.google.protobuf.DynamicMessage convertJsonToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema,
TableSchema tableSchema,
org.json.JSONObject json)
public com.google.protobuf.DynamicMessage convertToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema,
TableSchema tableSchema,
Object json,
boolean ignoreUnknownFields)
convertToProtoMessage in interface ToProtoConverter<Object>protoSchema - the schema of the output Protobuf schems.tableSchema - tha underlying table schema for which Protobuf is being built.json - the input JSON object converted to Protobuf.ignoreUnknownFields - flag indicating that the additional fields not present in the output
schema should be accepted.public com.google.protobuf.DynamicMessage convertToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema,
org.json.JSONObject json)
throws IllegalArgumentException
protoSchema - json - IllegalArgumentException - when JSON data is not compatible with proto descriptor.public com.google.protobuf.DynamicMessage convertToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema,
TableSchema tableSchema,
org.json.JSONObject json)
throws IllegalArgumentException
protoSchema - tableSchema - bigquery table schema is needed for type conversion of DATETIME, TIME,
NUMERIC, BIGNUMERICjson - IllegalArgumentException - when JSON data is not compatible with proto descriptor.public com.google.protobuf.DynamicMessage convertToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema,
TableSchema tableSchema,
org.json.JSONObject json,
boolean ignoreUnknownFields)
throws IllegalArgumentException
protoSchema - tableSchema - bigquery table schema is needed for type conversion of DATETIME, TIME,
NUMERIC, BIGNUMERICjson - ignoreUnknownFields - allows unknown fields in JSON input to be ignored.IllegalArgumentException - when JSON data is not compatible with proto descriptor.Copyright © 2023 Google LLC. All rights reserved.