Search in sources :

Example 36 with EzyObject

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

the class SettingObjectToField method toSetting.

public final FieldSetting toSetting(SettingObjectToFields mappers, EzyObject object) {
    FieldSetting setting = newSetting(mappers, object);
    setting.setNullable(object.get(SettingFields.NULLABLE));
    return setting;
}
Also used : FieldSetting(com.tvd12.dahlia.core.setting.FieldSetting)

Example 37 with EzyObject

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

the class SettingObjectToLongField method newSetting.

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

Example 38 with EzyObject

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

the class SettingObjectToShortField method newSetting.

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

Example 39 with EzyObject

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

the class SettingRuntimeSerializer method serialize.

@Override
public byte[] serialize(RuntimeSetting setting) {
    EzyObject object = settingToObject(setting);
    byte[] bytes = objectSerializer.serialize(object);
    return bytes;
}
Also used : EzyObject(com.tvd12.ezyfox.entity.EzyObject)

Example 40 with EzyObject

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

the class FindOptions method toObject.

public EzyObject toObject() {
    EzyObject obj = EzyEntityFactory.newObject();
    obj.put(OptionFields.SKIP, skip);
    obj.put(OptionFields.LIMIT, limit);
    EzyObject sort = EzyEntityFactory.newObject();
    for (Entry<String, Boolean> field : sortBy.entrySet()) sort.put(field.getKey(), field.getValue());
    obj.put(OptionFields.SORT, sort);
    return obj;
}
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