[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);
    }

Generated at Wed Feb 07 20:56:13 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.