Class BasicHttpResponse<SELF extends BasicHttpResponse<SELF>>

java.lang.Object
org.apache.juneau.http.classic.response.BasicHttpResponse<SELF>
Type Parameters:
SELF - The self type for fluent setters.
All Implemented Interfaces:
HttpMessage, HttpResponse
Direct Known Subclasses:
Accepted, AlreadyReported, Continue, Created, EarlyHints, Found, IMUsed, MovedPermanently, MultipleChoices, MultiStatus, NoContent, NonAuthoritiveInformation, NotModified, Ok, PartialContent, PermanentRedirect, Processing, ResetContent, SeeOther, SwitchingProtocols, TemporaryRedirect, UseProxy

@Marshalled(as=STRING) public abstract class BasicHttpResponse<SELF extends BasicHttpResponse<SELF>> extends Object implements HttpResponse
Basic implementation of the HttpResponse interface.

Although this class implements the various setters defined on the HttpResponse interface, it's in general going to be more efficient to set the status/headers/content of this bean through the builder.

Immutability is expressed with the "funnel + nested Unmodifiable snapshot" paradigm: every mutator (fluent setter and void interface mutator) routes through the single protected modify(Runnable) choke-point, and each concrete leaf gets a nested X.Unmodifiable whose only behavioral override is a throwing modify(...). A leaf's unmodifiable() factory returns a point-in-time snapshot of type X.Unmodifiable; any attempt to set a property on it throws an UnsupportedOperationException.

This is a self-typed (CRTP) root: a leaf declares class Ok extends BasicHttpResponse<Ok> and inherits leaf-typed fluent setters with no covariant overrides.

Notes:
  • Beans are not thread safe unless they're marked as unmodifiable.
See Also: