Send feedback
Class JsonToProtoMessage (2.36.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.36.0 keyboard_arrow_down
public class JsonToProtoMessage implements ToProtoConverter<Object>
Converts JSON data to Protobuf messages given the Protobuf descriptor and BigQuery table schema.
The Protobuf descriptor must have all fields lowercased.
Inheritance
Object >
JsonToProtoMessage
Implements
com.google.cloud.bigquery.storage.v1.ToProtoConverter<java.lang.Object>
Static Fields
INSTANCE
public static final JsonToProtoMessage INSTANCE
Static Methods
convertJsonToProtoMessage(Descriptors.Descriptor protoSchema, TableSchema tableSchema, JSONObject json)
public static DynamicMessage convertJsonToProtoMessage ( Descriptors . Descriptor protoSchema , TableSchema tableSchema , JSONObject json )
convertJsonToProtoMessage(Descriptors.Descriptor protoSchema, TableSchema tableSchema, JSONObject json, boolean ignoreUnknownFields)
public static DynamicMessage convertJsonToProtoMessage ( Descriptors . Descriptor protoSchema , TableSchema tableSchema , JSONObject json , boolean ignoreUnknownFields )
convertJsonToProtoMessage(Descriptors.Descriptor protoSchema, JSONObject json)
public static DynamicMessage convertJsonToProtoMessage ( Descriptors . Descriptor protoSchema , JSONObject json )
Parameters Name Description protoSchema
Descriptor
json
org.json.JSONObject
Constructors
JsonToProtoMessage()
public JsonToProtoMessage ()
Methods
convertToProtoMessage(Descriptors.Descriptor protoSchema, TableSchema tableSchema, Object json, boolean ignoreUnknownFields)
public DynamicMessage convertToProtoMessage ( Descriptors . Descriptor protoSchema , TableSchema tableSchema , Object json , boolean ignoreUnknownFields )
Converts input message to Protobuf
Parameters Name Description protoSchema
Descriptor
the schema of the output Protobuf schems.
tableSchema
TableSchema
tha underlying table schema for which Protobuf is being built.
json
Object
the input JSON object converted to Protobuf.
ignoreUnknownFields
boolean
flag indicating that the additional fields not present in the output
schema should be accepted.
Returns Type Description DynamicMessage
Converted message in Protobuf format.
convertToProtoMessage(Descriptors.Descriptor protoSchema, TableSchema tableSchema, JSONObject json)
public DynamicMessage convertToProtoMessage ( 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
convertToProtoMessage(Descriptors.Descriptor protoSchema, TableSchema tableSchema, JSONObject json, boolean ignoreUnknownFields)
public DynamicMessage convertToProtoMessage ( Descriptors . Descriptor protoSchema , TableSchema tableSchema , JSONObject json , boolean ignoreUnknownFields )
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
ignoreUnknownFields
boolean
allows unknown fields in JSON input to be ignored.
convertToProtoMessage(Descriptors.Descriptor protoSchema, JSONObject json)
public DynamicMessage convertToProtoMessage ( 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
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-05 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-05 UTC."],[],[]]