cmccabe edited a comment on pull request #8703:
URL: https://github.com/apache/kafka/pull/8703#issuecomment-632428809


   > What is the purpose of this new method? Should we add getOrCreate to 
ImplicitLinkedHashMultiCollection as well?
   
   The purpose is to make it easy to access map elements by their keys.  An 
example might help:
   
   ```
   int brokerId = 2;
   Broker broker = brokerCollection.getOrCreate(brokerId);
   ```
   
   Unfortunately, we can't add this to `ImplicitLinkedHashMultiCollection` 
because only the generated code has the notion of keys.  In 
`ImplicitLinkedHashMultiCollection`, we just have elements which is more 
awkward to deal with.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to