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

public Class EnglishReasonPhraseCatalog

extends Object
implements ReasonPhraseCatalog
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.http.ReasonPhraseCatalog
Annotations
@Contract
threading:IMMUTABLE
Imports
java.util.Locale, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.http.HttpStatus, .ReasonPhraseCatalog, org.apache.hc.core5.util.Args

English reason phrases for HTTP status codes.
Since
4.0

Field Summary

Modifier and TypeField and Description
public static final EnglishReasonPhraseCatalog
INSTANCE

The default instance of this catalog.

private static final String[][]
REASON_PHRASES

Reason phrases lookup table.

Constructor Summary

AccessConstructor and Description
protected
EnglishReasonPhraseCatalog()

Restricted default constructor, for derived classes.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the reason phrase, or null
getReason
(final int
the status code, in the range 100-599
status
,
final Locale
ignored
loc
)

Implements org.apache.hc.core5.http.ReasonPhraseCatalog.getReason.

Obtains the reason phrase for a status code.
private static void
setReason(final int
the status code for which to define the phrase
status
,
final String
the reason phrase for this status code
reason
)

Stores the given reason phrase, by status code.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final EnglishReasonPhraseCatalog INSTANCE

The default instance of this catalog. This catalog is thread safe, so there typically is no need to create other instances.

REASON_PHRASESback to summary
private static final String[][] REASON_PHRASES

Reason phrases lookup table.

Constructor Detail

EnglishReasonPhraseCatalogback to summary
protected EnglishReasonPhraseCatalog()

Restricted default constructor, for derived classes. If you need an instance of this class, use INSTANCE.

Method Detail

getReasonback to summary
public String getReason(final int status, final Locale loc)

Implements org.apache.hc.core5.http.ReasonPhraseCatalog.getReason.

Obtains the reason phrase for a status code.

Parameters
status:int

the status code, in the range 100-599

loc:Locale

ignored

Returns:String

the reason phrase, or null

Annotations
@Override
setReasonback to summary
private static void setReason(final int status, final String reason)

Stores the given reason phrase, by status code. Helper method to initialize the static lookup table.

Parameters
status:int

the status code for which to define the phrase

reason:String

the reason phrase for this status code