Class Statuses


  • public final class Statuses
    extends Object
    Factory for producing custom JAX-RS response status type instances.
    Author:
    Paul Sandoz
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static jakarta.ws.rs.core.Response.StatusType from​(int code)
      Create a new status type instance.
      static jakarta.ws.rs.core.Response.StatusType from​(int code, String reason)
      Create a new status type instance with a custom reason phrase.
      static jakarta.ws.rs.core.Response.StatusType from​(jakarta.ws.rs.core.Response.StatusType status, String reason)
      Create a new status type instance with a custom reason phrase.
    • Method Detail

      • from

        public static jakarta.ws.rs.core.Response.StatusType from​(int code)
        Create a new status type instance.

        For standard status codes listed in Response.Status enum, the default reason phrase is used. For any other status code an empty string is used as a reason phrase.

        Parameters:
        code - response status code.
        Returns:
        new status type instance representing a given response status code.
      • from

        public static jakarta.ws.rs.core.Response.StatusType from​(int code,
                                                                  String reason)
        Create a new status type instance with a custom reason phrase.
        Parameters:
        code - response status code.
        reason - custom response status reason phrase.
        Returns:
        new status type instance representing a given response status code and custom reason phrase.
      • from

        public static jakarta.ws.rs.core.Response.StatusType from​(jakarta.ws.rs.core.Response.StatusType status,
                                                                  String reason)
        Create a new status type instance with a custom reason phrase.
        Parameters:
        status - response status type.
        reason - custom response status reason phrase.
        Returns:
        new status type instance representing a given response status code and custom reason phrase.