Class Statuses


  • public final class Statuses
    extends java.lang.Object
    Factory for producing custom JAX-RS response status type instances.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  Statuses.StatusImpl  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Statuses()
      Prevents instantiation.
    • Method Summary

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

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Statuses

        private Statuses()
        Prevents instantiation.
    • Method Detail

      • from

        public static javax.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 javax.ws.rs.core.Response.StatusType from​(int code,
                                                                java.lang.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 javax.ws.rs.core.Response.StatusType from​(javax.ws.rs.core.Response.StatusType status,
                                                                java.lang.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.