[YANGTOOLS-1462] Expose pre-sized builders from Builders Created: 02/Nov/22 Updated: 04/Dec/22 Resolved: 04/Dec/22 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | data-impl |
| Affects Version/s: | None |
| Fix Version/s: | 10.0.2 |
| Type: | Improvement | Priority: | High |
| Reporter: | Robert Varga | Assignee: | Matúš Matok |
| Resolution: | Done | Votes: | 0 |
| Labels: | pt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
We have a few downstream users who are referencing ImmutableBuilders directly because that is the only way to access pre-sized constructors. These are ImmutableMapNodeBuilder, ImmutableUnkeyedListNodeBuilder and ImmutableUserMapNodeBuilder. Add static methods to Builders class to forward to these (and possibly others) in the form of:
public static CollectionNodeBuilder<MapEntryNode, UserMapNode> orderedMapBuilderWithExpectedSize(final int size) {
return ImmutableUserMapNodeBuilder.create(size);
}
|