use of org.motechproject.mds.dto.SettingOptions in project motech by motech.
the class FieldSetting method toDto.
public SettingDto toDto() {
List<SettingOptions> options = new ArrayList<>();
if (details.getTypeSettingOptions() != null) {
for (TypeSettingOption option : details.getTypeSettingOptions()) {
options.add(SettingOptions.valueOf(option.getName()));
}
}
Type valueType = details.getValueType();
SettingDto dto = new SettingDto();
dto.setType(valueType.toDto());
dto.setValue(valueType.parse(value));
dto.setName(details.getName());
dto.setOptions(options);
return dto;
}
Aggregations