We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The compiler will issue an error when it tries to compile a generic pojo annotated with @GeneratePojoBuilder(withFactoryMethod="*").
@GeneratePojoBuilder(withFactoryMethod="*")
For example:
@GeneratePojoBuilder(withFactoryMethod="*") public class Container<T> { private T value; public T getValue() { return value; } public void setValue(T value) { this.value = value; } }
When compiling this, I get the following error:
error: non-static type variable T cannot be referenced from a static context
The reason is, that the generated factory method does not declare the generic type variable T. It can't just reuse the one declared on class level.
public class ContainerBuilder<T extends Object> implements Cloneable { [...] public static ContainerBuilder<T> container() { return new ContainerBuilder(); }
Instead we have to introduce a new one and mapping it.
public static <T extends Object> ContainerBuilder<T> container() { return new ContainerBuilder<T>(); }
The text was updated successfully, but these errors were encountered:
cfb4c5f
mkarneim
No branches or pull requests
The compiler will issue an error when it tries to compile a generic pojo annotated with
@GeneratePojoBuilder(withFactoryMethod="*")
.For example:
When compiling this, I get the following error:
error: non-static type variable T cannot be referenced from a static context
The reason is, that the generated factory method does not declare the generic type variable T. It can't just reuse the one declared on class level.
Instead we have to introduce a new one and mapping it.
The text was updated successfully, but these errors were encountered: