Package io.helidon.common.http
Interface Http.ResponseStatus
-
- All Known Implementing Classes:
Http.Status
- Enclosing class:
- Http
public static interface Http.ResponseStatus
Base interface for status codes used in HTTP responses.Copied from JAX-RS.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Http.ResponseStatus.Family
An enumeration representing the class of status code.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description int
code()
Get the associated integer value representing the status code.static Http.ResponseStatus
create(int statusCode)
Convert a numerical status code into the corresponding ResponseStatus.static Http.ResponseStatus
create(int statusCode, String reasonPhrase)
Convert a numerical status code into the corresponding ResponseStatus.Http.ResponseStatus.Family
family()
Get the class of status code.String
reasonPhrase()
Get the reason phrase.
-
-
-
Method Detail
-
create
static Http.ResponseStatus create(int statusCode)
Convert a numerical status code into the corresponding ResponseStatus.As opposed to
Http.Status.find(int)
, this method is guaranteed to always return an instance. For an unknownHttp.Status
it creates an ad-hocHttp.ResponseStatus
.- Parameters:
statusCode
- the numerical status code- Returns:
- the matching ResponseStatus; either a
Http.Status
or an ad-hocHttp.ResponseStatus
-
create
static Http.ResponseStatus create(int statusCode, String reasonPhrase)
Convert a numerical status code into the corresponding ResponseStatus.It either returns an existing
Http.Status
if possible. For an unknownHttp.Status
it creates an ad-hocHttp.ResponseStatus
or whenever a custom reason phrase is provided.- Parameters:
statusCode
- the numerical status code; if known, ais returned
reasonPhrase
- the reason phrase; ifnull
or a known reason phrase, aHttp.Status
is returned; otherwise, a new instance is returned- Returns:
- the matching ResponseStatus; either a
Http.Status
or an ad-hocHttp.ResponseStatus
-
code
int code()
Get the associated integer value representing the status code.- Returns:
- the integer value representing the status code.
-
family
Http.ResponseStatus.Family family()
Get the class of status code.- Returns:
- the class of status code.
-
reasonPhrase
String reasonPhrase()
Get the reason phrase.- Returns:
- the reason phrase.
-
-