@Override public String toString() { return "RestResponse[headers=" + getHeaders() + ",cookies=" + getCookies() + ",status=" + getStatus() + ",entityLength=" + _entity.length() + "]"; } }
/** * An object that contains details of a REST response. * * Instances of RestResponse are immutable and thread-safe. New instances can be created using the * {@link RestResponseBuilder}. An existing RestResponse can be used as a prototype for * building a new RestResponse using the {@link #builder()} method. * * RestResponse is a response with full entity. * * @author Chris Pettitt * @author Zhenkai Zhu */ public interface RestResponse extends Response, RestMessage { RestResponse NO_RESPONSE = new RestResponseImpl( ByteString.empty(), Collections.<String, String>emptyMap(), Collections.<String>emptyList(), 0); /** * Returns a {@link RestResponseBuilder}, which provides a means of constructing a new * response using this response as a starting point. Changes made with the builder are * not reflected by this response instance. * * @return a builder for this response */ RestResponseBuilder builder(); }
public RestResponse buildCanonical() { return new RestResponseImpl(_entity, getCanonicalHeaders(), getCanonicalCookies(), getStatus()); } }
public RestResponse build() { return new RestResponseImpl(_entity, getHeaders(), getCookies(), getStatus()); }