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.

    • Method Detail

      • 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 unknown Http.Status it creates an ad-hoc Http.ResponseStatus or whenever a custom reason phrase is provided.

        Parameters:
        statusCode - the numerical status code; if known, a is returned
        reasonPhrase - the reason phrase; if null or a known reason phrase, a Http.Status is returned; otherwise, a new instance is returned
        Returns:
        the matching ResponseStatus; either a Http.Status or an ad-hoc Http.ResponseStatus
      • code

        int code()
        Get the associated integer value representing the status code.
        Returns:
        the integer value representing the status code.
      • reasonPhrase

        String reasonPhrase()
        Get the reason phrase.
        Returns:
        the reason phrase.