Search in sources :

Example 1 with ListKvArray

use of com.torodb.kvdocument.values.heap.ListKvArray in project torodb by torodb.

the class BaseArrayToArrayConverter method fromJsonValue.

@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public KvArray fromJsonValue(JsonArray value) {
    List<KvValue<?>> list = new ArrayList<>(value.size());
    for (JsonValue child : value) {
        ArrayConverter converter = valueToArrayConverterProvider.fromJsonValue(child);
        list.add(converter.fromJsonValue(child));
    }
    return new ListKvArray(list);
}
Also used : ListKvArray(com.torodb.kvdocument.values.heap.ListKvArray) ArrayList(java.util.ArrayList) JsonValue(javax.json.JsonValue) KvValue(com.torodb.kvdocument.values.KvValue)

Example 2 with ListKvArray

use of com.torodb.kvdocument.values.heap.ListKvArray in project torodb by torodb.

the class BaseArrayValueToJsonConverter method toValue.

@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public KvArray toValue(JsonArray value) {
    List<KvValue<?>> list = new ArrayList<>(value.size());
    for (JsonValue child : value) {
        ArrayConverter converter = valueToArrayConverterProvider.fromJsonValue(child);
        list.add(converter.fromJsonValue(child));
    }
    return new ListKvArray(list);
}
Also used : ListKvArray(com.torodb.kvdocument.values.heap.ListKvArray) ArrayList(java.util.ArrayList) JsonValue(javax.json.JsonValue) ArrayConverter(com.torodb.backend.converters.array.ArrayConverter) KvValue(com.torodb.kvdocument.values.KvValue)

Aggregations

KvValue (com.torodb.kvdocument.values.KvValue)2 ListKvArray (com.torodb.kvdocument.values.heap.ListKvArray)2 ArrayList (java.util.ArrayList)2 JsonValue (javax.json.JsonValue)2 ArrayConverter (com.torodb.backend.converters.array.ArrayConverter)1