Boolean Type: Support also cases when a number/string value are passed, closes #33.
This commit is contained in:
parent
e6b5ec7aaa
commit
4806df426a
|
@ -124,6 +124,18 @@ public class JsonBooleanFieldMapper extends JsonFieldMapper<Boolean> {
|
|||
if (nullValue != null) {
|
||||
value = nullValue ? "T" : "F";
|
||||
}
|
||||
} else if (token == JsonToken.VALUE_NUMBER_INT) {
|
||||
if (jsonContext.jp().getIntValue() == 0) {
|
||||
value = "F";
|
||||
} else {
|
||||
value = "T";
|
||||
}
|
||||
} else if (token == JsonToken.VALUE_STRING) {
|
||||
if (jsonContext.jp().getText().equals("false")) {
|
||||
value = "F";
|
||||
} else {
|
||||
value = "T";
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue