public class JsonToProtoMessage extends Object
Constructor and Description |
---|
JsonToProtoMessage() |
Modifier and Type | Method and Description |
---|---|
static com.google.protobuf.DynamicMessage |
convertJsonToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema,
org.json.JSONObject json,
boolean allowUnknownFields)
Converts Json data to protocol buffer messages given the protocol buffer descriptor.
|
public static com.google.protobuf.DynamicMessage convertJsonToProtoMessage(com.google.protobuf.Descriptors.Descriptor protoSchema, org.json.JSONObject json, boolean allowUnknownFields) throws IllegalArgumentException
protoSchema
- json
- allowUnknownFields
- Ignores unknown JSON fields.IllegalArgumentException
- when JSON data is not compatible with proto descriptor.Copyright © 2020 Google LLC. All rights reserved.