I'm generating code with JavaPoet.
Somewhere in the generated code I want to add a method which has the following argument.
...
public B someMethod(final AbstractObjectBuilder<Persoon,?> builder) {
...
}
...
So my JavaPoet code should look something like this
//This does not compile, since I don't know what to put as last argument (questionmark)
ParameterizedTypeName parameterizedTypeName = ParameterizedTypeName.get(AbstractObjectBuilder.class, propertyType,?);
ParameterSpec parameterSpec = ParameterSpec.builder(parameterizedTypeName, name+"Builder", Modifier.FINAL).build();
MethodSpec modMethod = MethodSpec.methodBuilder(name)
.addModifiers(Modifier.PUBLIC)
.addParameter(parameterSpec)
.returns(TypeVariableName.get("B"));
...
<Persoon, ? extends <any_class_name or Object>>
– Inclement