> + * @author Everett Toews
> + */
> +public class ParseMessages implements Function<HttpResponse, MessageStream> {
> +
> + private final ParseJson<MessagesWithHref> json;
> +
> + @Inject
> + ParseMessages(ParseJson<MessagesWithHref> json) {
> + this.json = checkNotNull(json, "json");
> + }
> +
> + @Override
> + public MessageStream apply(HttpResponse response) {
> + // An empty message stream has a 204 response code
> + if (response.getStatusCode() == 204) {
> + return new Messages(ImmutableSet.<Message> of(),
> ImmutableSet.<Link> of());
Use a builder?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/46/files#r7271008