use of org.hisp.dhis.api.mobile.model.ModelList in project dhis2-core by dhis2.
the class ModelMapping method getCategoryOptionCombos.
public static ModelList getCategoryOptionCombos(org.hisp.dhis.dataelement.DataElement dataElement) {
ModelList deCateOptCombo = new ModelList();
List<Model> listCateOptCombo = new ArrayList<>();
deCateOptCombo.setModels(listCateOptCombo);
for (DataElementCategoryOptionCombo oneCatOptCombo : dataElement.getSortedCategoryOptionCombos()) {
Model oneCateOptCombo = new Model();
oneCateOptCombo.setId(oneCatOptCombo.getId());
oneCateOptCombo.setName(oneCatOptCombo.getName());
listCateOptCombo.add(oneCateOptCombo);
}
return deCateOptCombo;
}
use of org.hisp.dhis.api.mobile.model.ModelList in project dhis2-core by dhis2.
the class ProgramStageDataElement method deSerialize.
@Override
public void deSerialize(DataInputStream dint) throws IOException {
super.deSerialize(dint);
this.setType(dint.readUTF());
if (dint.readBoolean()) {
this.setNumberType(dint.readUTF());
} else {
this.setNumberType(null);
}
this.setCompulsory(dint.readBoolean());
this.categoryOptionCombos = new ModelList();
this.categoryOptionCombos.deSerialize(dint);
if (dint.readBoolean() == false) {
this.optionSet = null;
} else {
this.optionSet = new OptionSet();
this.optionSet.deSerialize(dint);
}
if (dint.readBoolean() == false) {
this.setValue(null);
} else {
this.setValue(dint.readUTF());
}
}
Aggregations