Top Description Fields Constructors Methods
org.apache.hc.core5.http.impl.nio

public Class DefaultHttpResponseFactory

extends Object
implements HttpResponseFactory<HttpResponse>
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.http.HttpResponseFactory
Annotations
@Contract
threading:IMMUTABLE_CONDITIONAL
Imports
org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.http.HttpResponse, .HttpResponseFactory, .ReasonPhraseCatalog, org.apache.hc.core5.http.impl.EnglishReasonPhraseCatalog, org.apache.hc.core5.http.message.BasicHttpResponse, org.apache.hc.core5.util.Args

Default factory for creating HttpResponse objects.
Since
4.0

Field Summary

Modifier and TypeField and Description
public static final DefaultHttpResponseFactory
private final ReasonPhraseCatalog

Constructor Summary

AccessConstructor and Description
public
DefaultHttpResponseFactory(final ReasonPhraseCatalog
the catalog of reason phrases
catalog
)

Creates a new response factory with the given catalog.

public
DefaultHttpResponseFactory()

Creates a new response factory with the default catalog.

Method Summary

Modifier and TypeMethod and Description
public HttpResponse
newHttpResponse(final int
the status code
status
,
final String
the reason phrase
reasonPhrase
)

Implements org.apache.hc.core5.http.HttpResponseFactory.newHttpResponse.

Creates response message with the given code and reason phrase.
public HttpResponse
newHttpResponse(final int
the status code
status
)

Implements org.apache.hc.core5.http.HttpResponseFactory.newHttpResponse.

Creates a new response with the given code.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final DefaultHttpResponseFactory INSTANCE
reasonCatalogback to summary
private final ReasonPhraseCatalog reasonCatalog

Constructor Detail

DefaultHttpResponseFactoryback to summary
public DefaultHttpResponseFactory(final ReasonPhraseCatalog catalog)

Creates a new response factory with the given catalog.

Parameters
catalog:ReasonPhraseCatalog

the catalog of reason phrases

DefaultHttpResponseFactoryback to summary
public DefaultHttpResponseFactory()

Creates a new response factory with the default catalog. The default catalog is EnglishReasonPhraseCatalog.

Method Detail

newHttpResponseback to summary
public HttpResponse newHttpResponse(final int status, final String reasonPhrase)

Implements org.apache.hc.core5.http.HttpResponseFactory.newHttpResponse.

Doc from org.apache.hc.core5.http.HttpResponseFactory.newHttpResponse.

Creates response message with the given code and reason phrase.

Parameters
status:int

the status code

reasonPhrase:String

the reason phrase

Returns:HttpResponse

response message

Annotations
@Override
newHttpResponseback to summary
public HttpResponse newHttpResponse(final int status)

Implements org.apache.hc.core5.http.HttpResponseFactory.newHttpResponse.

Doc from org.apache.hc.core5.http.HttpResponseFactory.newHttpResponse.

Creates a new response with the given code.

Parameters
status:int

the status code

Returns:HttpResponse

response message

Annotations
@Override