Search in sources :

Example 26 with EzyObject

use of com.tvd12.ezyfox.entity.EzyObject in project dahlia by youngmonkeys.

the class SettingObjectToIntegerField method newSetting.

@Override
protected FieldIntegerSetting newSetting(SettingObjectToFields mappers, EzyObject object) {
    FieldIntegerSetting setting = new FieldIntegerSetting();
    setting.setDefaultValue(object.get(SettingFields.DEFAULT, int.class));
    setting.setMaxValue(object.get(SettingFields.MAX_VALUE, int.class));
    return setting;
}
Also used : FieldIntegerSetting(com.tvd12.dahlia.core.setting.FieldIntegerSetting)

Example 27 with EzyObject

use of com.tvd12.ezyfox.entity.EzyObject 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;
}
Also used : FieldSetting(com.tvd12.dahlia.core.setting.FieldSetting) FieldObjectSetting(com.tvd12.dahlia.core.setting.FieldObjectSetting) EzyArray(com.tvd12.ezyfox.entity.EzyArray)

Example 28 with EzyObject

use of com.tvd12.ezyfox.entity.EzyObject in project dahlia by youngmonkeys.

the class SettingObjectToTextField method newSetting.

@Override
protected FieldTextSetting newSetting(SettingObjectToFields mappers, EzyObject object) {
    FieldTextSetting setting = new FieldTextSetting();
    setting.setMaxSize(object.get(SettingFields.MAX_SIZE, int.class));
    setting.setDefaultValue(object.get(SettingFields.DEFAULT, String.class));
    return setting;
}
Also used : FieldTextSetting(com.tvd12.dahlia.core.setting.FieldTextSetting)

Example 29 with EzyObject

use of com.tvd12.ezyfox.entity.EzyObject 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;
}
Also used : EzyObject(com.tvd12.ezyfox.entity.EzyObject)

Example 30 with EzyObject

use of com.tvd12.ezyfox.entity.EzyObject 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;
}
Also used : EzyObject(com.tvd12.ezyfox.entity.EzyObject)

Aggregations

EzyObject (com.tvd12.ezyfox.entity.EzyObject)37 FieldSetting (com.tvd12.dahlia.core.setting.FieldSetting)19 EzyArray (com.tvd12.ezyfox.entity.EzyArray)17 CollectionSetting (com.tvd12.dahlia.core.setting.CollectionSetting)12 Collection (com.tvd12.dahlia.core.entity.Collection)11 Record (com.tvd12.dahlia.core.entity.Record)9 CollectionStorage (com.tvd12.dahlia.core.storage.CollectionStorage)9 HashMap (java.util.HashMap)6 RecordConsumer (com.tvd12.dahlia.core.function.RecordConsumer)5 DatabaseSetting (com.tvd12.dahlia.core.setting.DatabaseSetting)5 CollectionNotFoundException (com.tvd12.dahlia.exception.CollectionNotFoundException)5 DuplicatedIdException (com.tvd12.dahlia.exception.DuplicatedIdException)5 ArrayList (java.util.ArrayList)5 CollectionExistedException (com.tvd12.dahlia.exception.CollectionExistedException)4 DatabaseExistedException (com.tvd12.dahlia.exception.DatabaseExistedException)4 FindOptions (com.tvd12.dahlia.query.FindOptions)4 CommandCount (com.tvd12.dahlia.core.command.CommandCount)3 CommandFind (com.tvd12.dahlia.core.command.CommandFind)3 CommandInsertOne (com.tvd12.dahlia.core.command.CommandInsertOne)3 FieldLongSetting (com.tvd12.dahlia.core.setting.FieldLongSetting)3