@Contract(threading=IMMUTABLE_CONDITIONAL) public class DefaultHttpResponseFactory extends Object implements HttpResponseFactory<HttpResponse>
HttpResponse objects.| Modifier and Type | Field and Description |
|---|---|
static DefaultHttpResponseFactory |
INSTANCE |
| Constructor and Description |
|---|
DefaultHttpResponseFactory()
Creates a new response factory with the default catalog.
|
DefaultHttpResponseFactory(ReasonPhraseCatalog catalog)
Creates a new response factory with the given catalog.
|
| Modifier and Type | Method and Description |
|---|---|
HttpResponse |
newHttpResponse(int status)
Creates a new response with the given code.
|
HttpResponse |
newHttpResponse(int status,
String reasonPhrase)
Creates response message with the given code and reason phrase.
|
public static final DefaultHttpResponseFactory INSTANCE
public DefaultHttpResponseFactory(ReasonPhraseCatalog catalog)
catalog - the catalog of reason phrasespublic DefaultHttpResponseFactory()
EnglishReasonPhraseCatalog.public HttpResponse newHttpResponse(int status, String reasonPhrase)
HttpResponseFactorynewHttpResponse in interface HttpResponseFactory<HttpResponse>status - the status codereasonPhrase - the reason phrasepublic HttpResponse newHttpResponse(int status)
HttpResponseFactorynewHttpResponse in interface HttpResponseFactory<HttpResponse>status - the status codeCopyright © 2005–2022 The Apache Software Foundation. All rights reserved.