Randgalt / record-builder

Record builder generator for Java records

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Return interface type for @RecordInterface

DenWav opened this issue · comments

It would be nice to have an option for something like the following:

@RecordInterface
public interface SomeInterface extends SomeInterfaceRecordBuilder.With {
    String thingOne();
    String thingTwo();

    static SomeInterfaceRecordBuilder builder() {
        return SomeInterfaceRecordBuilder.builder();
    }
}

But when I do that, SomeInterface.builder().build() returns SomeInterfaceRecord rather than just SomeInterface.

Similarly an option for the with methods would be nice too.

I can see this. I don't have a lot of time at the moment. A PR would be appreciated otherwise I'll get to it when I can.