> + * @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());
Messages is a private class here so it won't leak out of this class. I don't see any value in adding a bunch of builder code. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-openstack/pull/46/files#r7657189