Abnaxos / meldioc

A prototype of an IoC (Inversion of Control) library for Java
MIT License
5 stars 1 forks source link

Change sandwich pattern for immutables again #111

Closed Abnaxos closed 2 years ago

Abnaxos commented 2 years ago

As of immutables 2.9.2, the builder in the template class can extend the generated builder, which removes a lot of boilerplate code. Adopt this.

Also, change some things in the PureImmutable annotation:

@Value.Style(
    typeImmutable = "*_Immutable",
    typeImmutableEnclosing = "*_Immutables", // change
    typeWith = "*_With",
    visibility = Value.Style.ImplementationVisibility.PACKAGE,
    builderVisibility = Value.Style.BuilderVisibility.PACKAGE,
    overshadowImplementation = true, // change
    throwForInvalidImmutableState = IllegalBuilderStateException.class)