use of org.openforis.idm.model.IntegerValue in project collect by openforis.
the class JSONValueParser method parseInteger.
public IntegerValue parseInteger(NumberAttributeDefinition attrDef, String value) {
Map<String, Object> map = parseJSONToMap(value, NumberValue.VALUE_FIELD);
if (map == null) {
return null;
}
Integer unitId = getInteger(map, NumberValue.UNIT_ID_FIELD);
Unit unit = attrDef.getActualUnit(unitId);
return new IntegerValue(getInteger(map, NumberValue.VALUE_FIELD), unit);
}
Aggregations