new DefaultFutureResult<Collection<V>>(result.cause()).setHandler(resultHandler);
}
}
});
} else if (result.result().body().getString("status").equals("error")) {
new DefaultFutureResult<Collection<V>>(new DataException(result.result().body().getString("message"))).setHandler(resultHandler);
} else {
JsonArray jsonValues = result.result().body().getArray("result");
if (jsonValues != null) {
List<V> values = new ArrayList<>();
for (Object value : jsonValues) {
values.add((V) value);
}
new DefaultFutureResult<Collection<V>>(values).setHandler(resultHandler);
} else {
new DefaultFutureResult<Collection<V>>(new DataException("Invalid response.")).setHandler(resultHandler);
}
}
}
});
}