I have class with below properties in my service, I want to create a grpc service for this. but i am not able to find how can i map Object data in protobuf.
public class FeatureDetails {
private String type;
private Object value;
private String label;
private Object options; }
I want protobuf for above variable which are of type Object
I have tried below code in protobuf.
oneof value {
string string_value = 4;
int32 int_value = 5;
bool bool_value = 6;
double double_value = 7; }
google.protobuf.Any value=8
But I am getting null in value & options for both the cases after
You will need to extend protobuf for using
Any
type with your ownjava.lang.Object
type for theoptions
field. This is described in https://protobuf.dev/reference/java/api-docs/com/google/protobuf/Any.Builder.html or https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Any.Builder