Class JsonToProtoMessage
java.lang.Object
com.google.cloud.bigquery.storage.v1beta2.JsonToProtoMessage
Converts Json data to protocol buffer messages given the protocol buffer descriptor. The protobuf
descriptor must have all fields lowercased.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.protobuf.DynamicMessageconvertJsonToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema, TableSchema tableSchema, org.json.JSONObject json) Converts Json data to protocol buffer messages given the protocol buffer descriptor.static com.google.protobuf.DynamicMessageconvertJsonToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema, org.json.JSONObject json) Converts Json data to protocol buffer messages given the protocol buffer descriptor.
-
Constructor Details
-
JsonToProtoMessage
public JsonToProtoMessage()
-
-
Method Details
-
convertJsonToProtoMessage
public static com.google.protobuf.DynamicMessage convertJsonToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema, org.json.JSONObject json) throws IllegalArgumentException Converts Json data to protocol buffer messages given the protocol buffer descriptor.- Parameters:
protoSchema-json-- Throws:
IllegalArgumentException- when JSON data is not compatible with proto descriptor.
-
convertJsonToProtoMessage
public static com.google.protobuf.DynamicMessage convertJsonToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema, TableSchema tableSchema, org.json.JSONObject json) throws IllegalArgumentException Converts Json data to protocol buffer messages given the protocol buffer descriptor.- Parameters:
protoSchema-tableSchema- bigquery table schema is needed for type conversion of DATETIME, TIME, NUMERIC, BIGNUMERICjson-- Throws:
IllegalArgumentException- when JSON data is not compatible with proto descriptor.
-