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

public Class DefaultClassicHttpResponseFactory

extends Object
implements HttpResponseFactory<ClassicHttpResponse>
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.ClassicHttpResponse, .HttpResponseFactory, .ReasonPhraseCatalog, org.apache.hc.core5.http.impl.EnglishReasonPhraseCatalog, org.apache.hc.core5.http.message.BasicClassicHttpResponse, org.apache.hc.core5.util.Args

Default factory for creating ClassicHttpResponse objects.
Since
4.0

Field Summary

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

Constructor Summary

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

Creates a new response factory with the given catalog.

public
DefaultClassicHttpResponseFactory()

Creates a new response factory with the default catalog.

Method Summary

Modifier and TypeMethod and Description
public ClassicHttpResponse
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 ClassicHttpResponse
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 DefaultClassicHttpResponseFactory INSTANCE
reasonCatalogback to summary
private final ReasonPhraseCatalog reasonCatalog

Constructor Detail

DefaultClassicHttpResponseFactoryback to summary
public DefaultClassicHttpResponseFactory(final ReasonPhraseCatalog catalog)

Creates a new response factory with the given catalog.

Parameters
catalog:ReasonPhraseCatalog

the catalog of reason phrases

DefaultClassicHttpResponseFactoryback to summary
public DefaultClassicHttpResponseFactory()

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

Method Detail

newHttpResponseback to summary
public ClassicHttpResponse 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:ClassicHttpResponse

response message

Annotations
@Override
newHttpResponseback to summary
public ClassicHttpResponse 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:ClassicHttpResponse

response message

Annotations
@Override