1

I have the mapping:

@Field(at = 123, length = 2, required = true)
private AccountStatus accountStatus;

And the Enum

public enum AccountStatus {
CURRENT("11"),
CLOSED("13"),
UNTIL_59_PASSED_DUE("71"),
UNTIL_89_PASSED_DUE("78"),
DELETE_FRAUD("DF"),
DELETE_ACCOUNT("DA");

public String value;

AccountStatus(String value) {
    this.value = value;
}
}

For AccountStatus.CURRENT it is generating 'CU' and I want 11 instead. How to do that configuration?

4

1 回答 1

3

尝试这个:

  • 覆盖枚举类中的 toString() 以便它返回您的“值”枚举变量的值并将属性添加format="toString"到 accountStatus @Field 注释。

或者

于 2018-09-18T15:56:37.620 回答