Class JsonToProtoMessage

java.lang.Object
com.google.cloud.bigquery.storage.v1beta2.JsonToProtoMessage

public class JsonToProtoMessage extends Object
Converts Json data to protocol buffer messages given the protocol buffer descriptor. The protobuf descriptor must have all fields lowercased.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.google.protobuf.DynamicMessage
    convertJsonToProtoMessage(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.DynamicMessage
    convertJsonToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema, org.json.JSONObject json)
    Converts Json data to protocol buffer messages given the protocol buffer descriptor.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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, BIGNUMERIC
      json -
      Throws:
      IllegalArgumentException - when JSON data is not compatible with proto descriptor.