Используя Play Framework, я сериализую свои модели через GSON. Я указываю, какие поля выставлены, а какие нет.
Это отлично работает, но я также хотел бы использовать метод @expose. Конечно, это слишком просто.
Как я могу это сделать?
Спасибо за вашу помощь!
public class Account extends Model {
@Expose
public String username;
@Expose
public String email;
public String password;
@Expose // Of course, this don't work
public String getEncodedPassword() {
// ...
}
}