I hope this is the right group.

I've generated a Java API for Helm's Tiller using gRPC and protocol 
buffers.  You can see the javadocs 
here: https://microbean.github.io/microbean-helm/apidocs/index.html  Look 
at the hapi.* packages.

As I'm working with the generated API, I need to add one kind of thing to 
another thing's list of such things.

Specifically (and arbitrarily) I need to add a (sub-) Chart.Builder to a 
(top-level) Chart.Builder's "dependencies", only if it isn't already 
present.

I can do this via the following generated methods:
https://microbean.github.io/microbean-helm/apidocs/hapi/chart/ChartOuterClass.Chart.Builder.html#addDependencies-hapi.chart.ChartOuterClass.Chart.Builder-
 
(Adds a Chart.Builder)
https://microbean.github.io/microbean-helm/apidocs/hapi/chart/ChartOuterClass.Chart.Builder.html#addDependenciesBuilder--
 
(I don't know what this does.)

It seems from looking at the generated source code that if I call build() 
on the "top level" Chart.Builder, it will cascade to the Chart.Builders 
present in the return value of getDependenciesBuilderList() and call 
build() on them too.

I also need to add a Chart.Builder only if it isn't present already.

When I tried to implement this logic, I found that no Chart.Builder added 
is equal to any other Chart.Builder.  That is, there doesn't seem to be the 
ability to check for a Chart.Builder "in" another Chart.Builder's list of 
dependencies.

Finally at the end of all this, I call build() on the top-level 
Chart.Builder and expect it to produce a Chart with some subcharts in its 
dependencies.  Should I in fact expect this?

Now I feel like I have the semantics about these generated methods all 
wrong.  Is there a better walkthrough 
than https://developers.google.com/protocol-buffers/docs/javatutorial?  Is 
there a standard way for assembling an object graph out of connected 
builders?

Thanks,
Best,
Laird

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to