what is the meaning of "Value" class in .proto file

can someone please explain me the meaning of "Value" in below .proto file?

message Test {
string id = 1;
string name = 2;
google.protobuf.Value property = 6;}

1 Answer

Without an import it probably shouldn't work, however: it represents a flexibly typed value; the Value "well known type" is essentially a union (oneof) of a few common types, with the Java API (from your tags) described here.

The definition is in struct.proto (hence you'll need import "google/protobuf/struct.proto";), or basically:

message Value { // The kind of value. oneof kind { // Represents a null value. NullValue null_value = 1; // Represents a double value. double number_value = 2; // Represents a string value. string string_value = 3; // Represents a boolean value. bool bool_value = 4; // Represents a structured value. Struct struct_value = 5; // Represents a repeated `Value`. ListValue list_value = 6; }
}

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like