use of com.tvd12.ezyfox.entity.EzyObject in project dahlia by youngmonkeys.
the class SettingCollectionSerializer method serialize.
@Override
public byte[] serialize(CollectionSetting setting) {
EzyObject object = collectionToObject(setting);
byte[] bytes = objectSerializer.serialize(object);
return bytes;
}
use of com.tvd12.ezyfox.entity.EzyObject in project dahlia by youngmonkeys.
the class SettingDatabaseDeserializer method deserialize.
@Override
public DatabaseSetting deserialize(byte[] bytes) {
EzyObject object = objectDeserializer.deserialize(bytes);
DatabaseSetting setting = new DatabaseSetting();
setting.setDatabaseId(object.get(SettingFields.ID, int.class));
return setting;
}
use of com.tvd12.ezyfox.entity.EzyObject 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.ezyfox.entity.EzyObject 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.ezyfox.entity.EzyObject in project dahlia by youngmonkeys.
the class SettingObjectToFloatField method newSetting.
@Override
protected FieldFloatSetting newSetting(SettingObjectToFields mappers, EzyObject object) {
FieldFloatSetting setting = new FieldFloatSetting();
setting.setDefaultValue(object.get(SettingFields.DEFAULT, float.class));
return setting;
}
Aggregations