Class JsonToProtoMessage (3.5.1)

public class JsonToProtoMessage

Converts Json data to protocol buffer messages given the protocol buffer descriptor. The protobuf descriptor must have all fields lowercased.

This client lib is deprecated, please use v1 instead.

Inheritance

java.lang.Object > JsonToProtoMessage

Static Methods

convertJsonToProtoMessage(Descriptors.Descriptor protoSchema, TableSchema tableSchema, JSONObject json) (deprecated)

public static DynamicMessage convertJsonToProtoMessage(Descriptors.Descriptor protoSchema, TableSchema tableSchema, JSONObject json)

Converts Json data to protocol buffer messages given the protocol buffer descriptor.

Parameters
Name Description
protoSchema Descriptor
tableSchema TableSchema

bigquery table schema is needed for type conversion of DATETIME, TIME, NUMERIC, BIGNUMERIC

json org.json.JSONObject
Returns
Type Description
DynamicMessage
Exceptions
Type Description
IllegalArgumentException

when JSON data is not compatible with proto descriptor.

convertJsonToProtoMessage(Descriptors.Descriptor protoSchema, JSONObject json) (deprecated)

public static DynamicMessage convertJsonToProtoMessage(Descriptors.Descriptor protoSchema, JSONObject json)

Converts Json data to protocol buffer messages given the protocol buffer descriptor.

Parameters
Name Description
protoSchema Descriptor
json org.json.JSONObject
Returns
Type Description
DynamicMessage
Exceptions
Type Description
IllegalArgumentException

when JSON data is not compatible with proto descriptor.

Constructors

JsonToProtoMessage() (deprecated)

public JsonToProtoMessage()