Consider replacing/augmenting MutableStructFields
with an idiomatic builder class
#98
Labels
enhancement
New feature or request
The
StructElement.update()
method accepts aConsumer<MutableStructFields>
, which hasCollection
/Map
-like APIs. This leads to less-than-ideal code, such as this:If we had a
StructElementBuilder
with proper builder-style APIs (i.e. that returnthis
) and specialized functions for modifying fields that have a container value, then we could write code like this instead:Formatting quibbles aside, the second example is more concise because we can chain together a series of
add
,set
, andremove
calls.The text was updated successfully, but these errors were encountered: