Randgalt / record-builder

Record builder generator for Java records

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

generate "add" method for collections

maxandersen opened this issue · comments

given this:

record Rule(String name, Filter filter, List<Action>) {}

I would love I could do:

RuleBuilder.name("arule").filter(f().from("max@acme.org")).action(markAsSeen()).action(fileTo("folder")).build()

Basically, in addition to generating action(List<Action>) add a action(Action) that builds up the list.

Add this:

@RecordBuilder.Options(addSingleItemCollectionBuilders = true, useImmutableCollections = true)