> + private final ParseJson<List<MessageWithHref>> json;
> +
> + @Inject
> + ParseMessagesToList(ParseJson<List<MessageWithHref>> json) {
> + this.json = checkNotNull(json, "json");
> + }
> +
> + @Override
> + public List<Message> apply(HttpResponse response) {
> + // An empty message stream has a 204 response code
> + if (response.getStatusCode() == 204) {
> + return ImmutableList.of();
> + }
> +
> + List<MessageWithHref> messagesWithHref = json.apply(response);
> + return Lists.newArrayList(transform(messagesWithHref, TO_MESSAGE));
Rather than `ImmutableList.copyOf`? Or is it likely that users will attempt to
mutate the list?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/57/files#r7881667