> +   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));

Not really sure. But will error on the side of immutability. Fixed.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/57/files#r7881771

Reply via email to