use of com.tvd12.dahlia.core.setting.FieldSetting in project dahlia by youngmonkeys.
the class SettingObjectToFields method toSetting.
public FieldSetting toSetting(EzyObject object) {
DataType type = DataType.valueOf(object.get(SettingFields.TYPE));
SettingObjectToField mapper = mappers.get(type);
FieldSetting answer = mapper.toSetting(this, object);
return answer;
}
use of com.tvd12.dahlia.core.setting.FieldSetting in project dahlia by youngmonkeys.
the class SettingObjectToFields method toFieldSettings.
public Map<String, FieldSetting> toFieldSettings(EzyArray array) {
Map<String, FieldSetting> fields = new HashMap<>();
for (int i = 0; i < array.size(); ++i) {
EzyObject object = array.get(i);
String name = object.get(SettingFields.NAME);
FieldSetting field = toSetting(object);
fields.put(name, field);
}
return fields;
}
use of com.tvd12.dahlia.core.setting.FieldSetting in project dahlia by youngmonkeys.
the class SettingObjectToObjectField method newSetting.
@Override
protected FieldObjectSetting newSetting(SettingObjectToFields mappers, EzyObject object) {
FieldObjectSetting setting = new FieldObjectSetting();
EzyArray fieldSettings = object.get(SettingFields.FIELDS, EzyArray.class);
Map<String, FieldSetting> fields = mappers.toFieldSettings(fieldSettings);
setting.setFields(fields);
return setting;
}
use of com.tvd12.dahlia.core.setting.FieldSetting in project dahlia by youngmonkeys.
the class SettingFieldToObjects method toObject.
public EzyObject toObject(FieldSetting setting) {
SettingFieldToObject mapper = mappers.get(setting.getType());
EzyObject answer = mapper.toObject(this, setting);
return answer;
}
use of com.tvd12.dahlia.core.setting.FieldSetting in project dahlia by youngmonkeys.
the class SettingFieldToObjects method toObject.
public EzyObject toObject(String name, FieldSetting setting) {
EzyObject answer = toObject(setting);
answer.put(SettingFields.NAME, name);
return answer;
}
Aggregations