Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
java 8 Optional representation problem
Let's consider the following simple model
Person {
private String name;
private String country;
public void setName(String name) {this.name = name;}
public void setCountry(String country) {this.country = country;}
public String getName() {return name;}
public Optional<String> getCountry() {return Optional.ofNullable(country);}
}
Is there a way to use FieldGroup to generate a form for this type of model?
The problem is that it tries to convert Optional to a presentation type, but even if I do implement the Converter interface, the problem is that the setter does not receive a Optional parameter, but a normal String parameter.
Any suggestion on how can I handle this? (I would like to keep the Optional on the getter and not remove it or replace it with Null Object Pattern, a Optional wrapper or create a proxy for the Person model)
Thank you.