Enum StatusCode

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<StatusCode>

    public enum StatusCode
    extends java.lang.Enum<StatusCode>
    Enum for HTTP status codes
    Author:
    https://github.com/mcweba [Marc-Andre Weber]
    • Enum Constant Detail

      • ACCEPTED

        public static final StatusCode ACCEPTED
      • NOT_MODIFIED

        public static final StatusCode NOT_MODIFIED
      • BAD_REQUEST

        public static final StatusCode BAD_REQUEST
      • FORBIDDEN

        public static final StatusCode FORBIDDEN
      • NOT_FOUND

        public static final StatusCode NOT_FOUND
      • METHOD_NOT_ALLOWED

        public static final StatusCode METHOD_NOT_ALLOWED
      • CONFLICT

        public static final StatusCode CONFLICT
      • UNSUPPORTED_MEDIA_TYPE

        public static final StatusCode UNSUPPORTED_MEDIA_TYPE
      • INTERNAL_SERVER_ERROR

        public static final StatusCode INTERNAL_SERVER_ERROR
      • BAD_GATEWAY

        public static final StatusCode BAD_GATEWAY
      • SERVICE_UNAVAILABLE

        public static final StatusCode SERVICE_UNAVAILABLE
      • INSUFFICIENT_STORAGE

        public static final StatusCode INSUFFICIENT_STORAGE
    • Method Detail

      • values

        public static StatusCode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (StatusCode c : StatusCode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static StatusCode valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getStatusCode

        public int getStatusCode()
      • getStatusMessage

        public java.lang.String getStatusMessage()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<StatusCode>
      • fromCode

        public static StatusCode fromCode​(int code)
        Returns the enum StatusCode which matches the specified http status code.
        Parameters:
        code - code
        Returns:
        The matching StatusCode or null if none matches.