You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When annotating a method for building it is currently the case that it must be a proper static Factory Method. If the method is written solely for the builder to use, it would be nice to place it in a scope where only the builder can access it. The best way to do this is with package access. This can be improved upon further though by making an instance method on a baseclass to improve encapsulation.
So long as the method is accessible then it should be legal to annotate it:
public AbstractFruitBuilder {
@GeneratePojoBuilder(withBaseclass=AbstractFruitBuilder.class)
Fruit createFruit( String type, Color color ) {
return new Fruit( type, color );
}
}
In theory this should hold even if there are other classes in a hierarchy between AbstractFruitBuilder and the baseclass.
The text was updated successfully, but these errors were encountered:
When annotating a method for building it is currently the case that it must be a proper static Factory Method. If the method is written solely for the builder to use, it would be nice to place it in a scope where only the builder can access it. The best way to do this is with package access. This can be improved upon further though by making an instance method on a baseclass to improve encapsulation.
So long as the method is accessible then it should be legal to annotate it:
In theory this should hold even if there are other classes in a hierarchy between AbstractFruitBuilder and the baseclass.
The text was updated successfully, but these errors were encountered: