You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently you can use @Singular on a Map to produce an immutable Map with convenient methods on the builder for adding a single entry. If you were to do a Map<?, Collection<?>>, this also works, offering a method to add a collection as a single entry for the builder, but what about adding a single item to a possibly existing collection, and making that collection immutable?
There are other ways it could be done, you could track a Collection<?> as a separate element and add it to a builder only once it is completed, but I think it would be nice to maintain the builder as the primary mechanism
Currently you can use
@Singular
on aMap
to produce an immutableMap
with convenient methods on the builder for adding a single entry. If you were to do aMap<?, Collection<?>>
, this also works, offering a method to add a collection as a single entry for the builder, but what about adding a single item to a possibly existing collection, and making that collection immutable?There are other ways it could be done, you could track a
Collection<?>
as a separate element and add it to a builder only once it is completed, but I think it would be nice to maintain the builder as the primary mechanismExample:
Possible Sample Builder Code:
The text was updated successfully, but these errors were encountered: