Package org.apache.hc.core5.http.impl.io
Class DefaultClassicHttpResponseFactory
java.lang.Object
org.apache.hc.core5.http.impl.io.DefaultClassicHttpResponseFactory
- All Implemented Interfaces:
HttpResponseFactory<ClassicHttpResponse>
@Contract(threading=IMMUTABLE_CONDITIONAL)
public class DefaultClassicHttpResponseFactory
extends Object
implements HttpResponseFactory<ClassicHttpResponse>
Default factory for creating
ClassicHttpResponse
objects.- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DefaultClassicHttpResponseFactory
private final ReasonPhraseCatalog
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new response factory with the default catalog.Creates a new response factory with the given catalog. -
Method Summary
Modifier and TypeMethodDescriptionnewHttpResponse
(int status) Creates a new response with the given code.newHttpResponse
(int status, String reasonPhrase) Creates response message with the given code and reason phrase.
-
Field Details
-
INSTANCE
-
reasonCatalog
-
-
Constructor Details
-
DefaultClassicHttpResponseFactory
Creates a new response factory with the given catalog.- Parameters:
catalog
- the catalog of reason phrases
-
DefaultClassicHttpResponseFactory
public DefaultClassicHttpResponseFactory()Creates a new response factory with the default catalog. The default catalog isEnglishReasonPhraseCatalog
.
-
-
Method Details
-
newHttpResponse
Description copied from interface:HttpResponseFactory
Creates response message with the given code and reason phrase.- Specified by:
newHttpResponse
in interfaceHttpResponseFactory<ClassicHttpResponse>
- Parameters:
status
- the status codereasonPhrase
- the reason phrase- Returns:
- response message
-
newHttpResponse
Description copied from interface:HttpResponseFactory
Creates a new response with the given code.- Specified by:
newHttpResponse
in interfaceHttpResponseFactory<ClassicHttpResponse>
- Parameters:
status
- the status code- Returns:
- response message
-