I am changing a library that uses Immutables.
In the class that I change I just added a new variable and in the generated classes I see different signatures in the create and of methods.
ImmutableMyClass.of(previous variables ..., int varNew)
ModifiableMyClass.create(previous variables ..., int varNew)
Since there are users of this library that call the previous versions of these methods I need to keep previous versions while providing the new versions for a new feature; otherwise, apparently, I am breaking the backward compatibility.
How do I have Immutables create custom create and of methods?
You just add the missing methods yourself as defined in library documentation here : https://immutables.github.io/immutable.html#expressive-factory-methods. So for the missing methods you define
public static MyClass of(...)andpublic static MyClass create(...)methods as below