Skip to content

Helpers for fields with ArrayList - #90

Merged
AndreasIgel merged 2 commits into
mainfrom
feature/helpers-for-fields-with-arraylist
Oct 27, 2025
Merged

AndreasIgel merged 2 commits into
mainfrom
feature/helpers-for-fields-with-arraylist

Conversation

@AndreasIgel

Copy link
Copy Markdown
Collaborator

Added features

Providing helper functions for ArrayLists (closes #89):

// Existing methods (unchanged)
public PersonBuilder names(String... names)
public PersonBuilder names(Supplier<String[]> namesSupplier)

// NEW: List parameter method
public PersonBuilder names(List<String> names) {
    this.names = changedValue(names.toArray(new String[0]));
    return this;
}

// NEW: ArrayListBuilder consumer
public PersonBuilder names(Consumer<ArrayListBuilder<String>> namesBuilderConsumer) {
    ArrayListBuilder<String> builder = this.names.isSet() 
        ? new ArrayListBuilder<>(List.of(this.names.value())) 
        : new ArrayListBuilder<>();
    namesBuilderConsumer.accept(builder);
    this.names = changedValue(builder.build().toArray(new String[0]));
    return this;
}

@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Oct 27, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@AndreasIgel
AndreasIgel merged commit ad4d55e into main Oct 27, 2025
8 checks passed
@AndreasIgel
AndreasIgel deleted the feature/helpers-for-fields-with-arraylist branch October 27, 2025 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fields with ArrayLists should have helper-functions too

1 participant