use of io.cdap.cdap.internal.guava.reflect.TypeParameter in project cdap by caskdata.
the class AbstractSpecificationCodec method deserializeMap.
protected final <V> Map<String, V> deserializeMap(JsonElement json, JsonDeserializationContext context, Class<V> valueType) {
Type type = new TypeToken<Map<String, V>>() {
}.where(new TypeParameter<V>() {
}, valueType).getType();
Map<String, V> map = context.deserialize(json, type);
return map == null ? Collections.<String, V>emptyMap() : map;
}
use of io.cdap.cdap.internal.guava.reflect.TypeParameter in project cdap by caskdata.
the class AbstractSpecificationCodec method deserializeSet.
protected final <V> Set<V> deserializeSet(JsonElement json, JsonDeserializationContext context, Class<V> valueType) {
Type type = new TypeToken<Set<V>>() {
}.where(new TypeParameter<V>() {
}, valueType).getType();
Set<V> set = context.deserialize(json, type);
return set == null ? Collections.<V>emptySet() : set;
}
use of io.cdap.cdap.internal.guava.reflect.TypeParameter in project cdap by caskdata.
the class AbstractSpecificationCodec method deserializeList.
protected final <V> List<V> deserializeList(JsonElement json, JsonDeserializationContext context, Class<V> valueType) {
Type type = new TypeToken<List<V>>() {
}.where(new TypeParameter<V>() {
}, valueType).getType();
List<V> list = context.deserialize(json, type);
return list == null ? Collections.<V>emptyList() : list;
}
Aggregations