public ConfigItem(String key, Object val) { this.key = key; this.val = ValueObject.of(val); }
public ConfigItem(String key, Object val) { this.key = key; this.val = ValueObject.of(val); }
/** * Put a map of (key, value) pair into the store. The value could be any type * that supported by {@link ValueObject} * @param kvMap a map of {key, value} pair */ @Override public KVStore putValues(Map<String, Object> kvMap) { for (String key : kvMap.keySet()) { put(key, ValueObject.of(kvMap.get(key))); } return this; }
public ConfigItem(String key, Config config) { this.key = key; this.val = ValueObject.of(config.get(key)); }
/** * Put a map of (key, value) pair into the store. The value could be any type * that supported by {@link ValueObject} * @param kvMap a map of {key, value} pair */ @Override public KVStore putValues(Map<String, Object> kvMap) { for (String key : kvMap.keySet()) { put(key, ValueObject.of(kvMap.get(key))); } return this; }
/** * Put a simple data into the store with a key. The type of simple data * should be allowed by {@link ValueObject} * @param key the key * @param val the value * @return this store instance after the put operation finished * @see ValueObject */ @Override public KVStore putValue(String key, Object val) { put(key, ValueObject.of(val)); return this; }
public ConfigItem(String key, Config config) { this.key = key; this.val = ValueObject.of(config.get(key)); }
/** * Put a simple data into the store with a key. The type of simple data * should be allowed by {@link ValueObject} * @param key the key * @param val the value * @return this store instance after the put operation finished * @see ValueObject */ @Override public KVStore putValue(String key, Object val) { put(key, ValueObject.of(val)); return this; }
@Override public List<Object> parse(String s) { JSONArray array = JSON.parseArray(s); List<Object> list = C.newSizedList(array.size()); for (Object o : array) { list.add(ValueObject.of(o)); } return list; }
@Override public List<Object> parse(String s) { JSONArray array = JSON.parseArray(s); List<Object> list = C.newSizedList(array.size()); for (Object o : array) { list.add(ValueObject.of(o)); } return list; }
@Override public T parse(String s) { JSONObject json = JSON.parseObject(s); T map = Act.app().getInstance(targetClass); for (Map.Entry<String, Object> entry : json.entrySet()) { map.put(entry.getKey(), ValueObject.of(entry.getValue())); } return map; }
@Override public T parse(String s) { JSONObject json = JSON.parseObject(s); T map = Act.app().getInstance(targetClass); for (Map.Entry<String, Object> entry : json.entrySet()) { map.put(entry.getKey(), ValueObject.of(entry.getValue())); } return map; }
@Override public String toJSONString(Keyword o) { return ValueObject.of(o.underscore()).toJSONString(); }
@Override public String toJSONString(Keyword o) { return ValueObject.of(o.underscore()).toJSONString(); }
List<Object> list = (List)v; for (Object item : list) { dbList.add(encode(ValueObject.of(item), optionalExtraInfo));
@Override public Object encode(Object value, MappedField optionalExtraInfo) { if (null == value) { return null; } Map<String, Object> map = (Map) value; boolean persistAsList = this.persistAsList || (null != optionalExtraInfo && optionalExtraInfo.hasAnnotation(PersistAsList.class) && !optionalExtraInfo.hasAnnotation(PersistAsMap.class)); if (persistAsList) { BasicDBList list = new BasicDBList(); for (String key : map.keySet()) { ValueObject vo = ValueObject.of(map.get(key)); BasicDBObject dbObject = new BasicDBObject(); dbObject.put(KEY, key); dbObject.put(VALUE, valueObjectConverter.encode(vo, optionalExtraInfo)); list.add(dbObject); } return list; } else { return encodeAsMap(map); } }