Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

how to ignore a field while desiarilizing in java if its type is not wrong

public class UserAccount implements HasMoney {
    @JsonIgnore
    private BigDecimal money;

    // Other variable declarations, constructors

    @Override
    @JsonProperty
    public BigDecimal getMoney() {
        return money;
    }

    @JsonIgnore
    @Override
    public void setMoney(final BigDecimal money) {
        this.money = money;
    }

    // Other getters/setters
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #ignore #field #desiarilizing #java #type #wrong
ADD COMMENT
Topic
Name
7+7 =