I wonder if there is a smarter way to cast a JsonArray to a List of specific type.
Currently I use (List<String>)json.getJsonArray("recipients").getList(), which works and giving an exception if either the entry is not an array or the array elements are not Strings, but this gives a warning about unchecked operations (which is obviously correct). Can this be done another way so that it works without a warning?
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
JsonArray jarr = new JsonArray(messageAsyncResult.result().bodyAsString());
List<Customer> cl = (List<Customer>) jarr.getList().stream().map(s -> DatabindCodec.mapper().convertValue(s, Customer.class)).collect(Collectors.toList());