Class StatusCodes


  • public final class StatusCodes
    extends java.lang.Object
    Contains the set of predefined status-codes along with static methods to access and create custom status-codes.
    • Field Detail

      • CONTINUE

        public static final StatusCode CONTINUE
      • SWITCHING_PROTOCOLS

        public static final StatusCode SWITCHING_PROTOCOLS
      • PROCESSING

        public static final StatusCode PROCESSING
      • EARLY_HINTS

        @ApiMayChange
        public static final StatusCode EARLY_HINTS
      • ACCEPTED

        public static final StatusCode ACCEPTED
      • NON_AUTHORITATIVE_INFORMATION

        public static final StatusCode NON_AUTHORITATIVE_INFORMATION
      • NO_CONTENT

        public static final StatusCode NO_CONTENT
      • RESET_CONTENT

        public static final StatusCode RESET_CONTENT
      • PARTIAL_CONTENT

        public static final StatusCode PARTIAL_CONTENT
      • MULTI_STATUS

        public static final StatusCode MULTI_STATUS
      • ALREADY_REPORTED

        public static final StatusCode ALREADY_REPORTED
      • MULTIPLE_CHOICES

        public static final StatusCode MULTIPLE_CHOICES
      • MOVED_PERMANENTLY

        public static final StatusCode MOVED_PERMANENTLY
      • SEE_OTHER

        public static final StatusCode SEE_OTHER
      • NOT_MODIFIED

        public static final StatusCode NOT_MODIFIED
      • USE_PROXY

        public static final StatusCode USE_PROXY
      • TEMPORARY_REDIRECT

        public static final StatusCode TEMPORARY_REDIRECT
      • PERMANENT_REDIRECT

        public static final StatusCode PERMANENT_REDIRECT
      • BAD_REQUEST

        public static final StatusCode BAD_REQUEST
      • UNAUTHORIZED

        public static final StatusCode UNAUTHORIZED
      • PAYMENT_REQUIRED

        public static final StatusCode PAYMENT_REQUIRED
      • FORBIDDEN

        public static final StatusCode FORBIDDEN
      • NOT_FOUND

        public static final StatusCode NOT_FOUND
      • METHOD_NOT_ALLOWED

        public static final StatusCode METHOD_NOT_ALLOWED
      • NOT_ACCEPTABLE

        public static final StatusCode NOT_ACCEPTABLE
      • PROXY_AUTHENTICATION_REQUIRED

        public static final StatusCode PROXY_AUTHENTICATION_REQUIRED
      • REQUEST_TIMEOUT

        public static final StatusCode REQUEST_TIMEOUT
      • CONFLICT

        public static final StatusCode CONFLICT
      • LENGTH_REQUIRED

        public static final StatusCode LENGTH_REQUIRED
      • PRECONDITION_FAILED

        public static final StatusCode PRECONDITION_FAILED
      • CONTENT_TOO_LARGE

        public static final StatusCode CONTENT_TOO_LARGE
      • PAYLOAD_TOO_LARGE

        @Deprecated
        public static final StatusCode PAYLOAD_TOO_LARGE
        Deprecated.
        deprecated in favor of CONTENT_TOO_LARGE
      • REQUEST_ENTITY_TOO_LARGE

        @Deprecated
        public static final StatusCode REQUEST_ENTITY_TOO_LARGE
        Deprecated.
        deprecated in favor of CONTENT_TOO_LARGE
      • URI_TOO_LONG

        public static final StatusCode URI_TOO_LONG
      • REQUEST_URI_TOO_LONG

        @Deprecated
        public static final StatusCode REQUEST_URI_TOO_LONG
        Deprecated.
        deprecated in favor of URI_TOO_LONG
      • UNSUPPORTED_MEDIA_TYPE

        public static final StatusCode UNSUPPORTED_MEDIA_TYPE
      • RANGE_NOT_SATISFIABLE

        public static final StatusCode RANGE_NOT_SATISFIABLE
      • REQUESTED_RANGE_NOT_SATISFIABLE

        @Deprecated
        public static final StatusCode REQUESTED_RANGE_NOT_SATISFIABLE
        Deprecated.
        deprecated in favor of RANGE_NOT_SATISFIABLE
      • EXPECTATION_FAILED

        public static final StatusCode EXPECTATION_FAILED
      • IM_A_TEAPOT

        public static final StatusCode IM_A_TEAPOT
      • ENHANCE_YOUR_CALM

        public static final StatusCode ENHANCE_YOUR_CALM
      • MISDIRECTED_REQUEST

        public static final StatusCode MISDIRECTED_REQUEST
      • UNPROCESSABLE_CONTENT

        public static final StatusCode UNPROCESSABLE_CONTENT
      • UNPROCESSABLE_ENTITY

        @Deprecated
        public static final StatusCode UNPROCESSABLE_ENTITY
        Deprecated.
        deprecated in favor of UNPROCESSABLE_CONTENT
      • FAILED_DEPENDENCY

        public static final StatusCode FAILED_DEPENDENCY
      • UNORDERED_COLLECTION

        @Deprecated
        public static final StatusCode UNORDERED_COLLECTION
        Deprecated.
        Non-standard Unordered Collection should not be used, deprecated in favor of TOO_EARLY
      • TOO_EARLY

        public static final StatusCode TOO_EARLY
      • UPGRADE_REQUIRED

        public static final StatusCode UPGRADE_REQUIRED
      • PRECONDITION_REQUIRED

        public static final StatusCode PRECONDITION_REQUIRED
      • TOO_MANY_REQUESTS

        public static final StatusCode TOO_MANY_REQUESTS
      • REQUEST_HEADER_FIELDS_TOO_LARGE

        public static final StatusCode REQUEST_HEADER_FIELDS_TOO_LARGE
      • RETRY_WITH

        public static final StatusCode RETRY_WITH
      • BLOCKED_BY_PARENTAL_CONTROLS

        public static final StatusCode BLOCKED_BY_PARENTAL_CONTROLS
      • UNAVAILABLE_FOR_LEGAL_REASONS

        public static final StatusCode UNAVAILABLE_FOR_LEGAL_REASONS
      • INTERNAL_SERVER_ERROR

        public static final StatusCode INTERNAL_SERVER_ERROR
      • NOT_IMPLEMENTED

        public static final StatusCode NOT_IMPLEMENTED
      • BAD_GATEWAY

        public static final StatusCode BAD_GATEWAY
      • SERVICE_UNAVAILABLE

        public static final StatusCode SERVICE_UNAVAILABLE
      • GATEWAY_TIMEOUT

        public static final StatusCode GATEWAY_TIMEOUT
      • HTTPVERSION_NOT_SUPPORTED

        public static final StatusCode HTTPVERSION_NOT_SUPPORTED
      • VARIANT_ALSO_NEGOTIATES

        public static final StatusCode VARIANT_ALSO_NEGOTIATES
      • INSUFFICIENT_STORAGE

        public static final StatusCode INSUFFICIENT_STORAGE
      • LOOP_DETECTED

        public static final StatusCode LOOP_DETECTED
      • BANDWIDTH_LIMIT_EXCEEDED

        public static final StatusCode BANDWIDTH_LIMIT_EXCEEDED
      • NOT_EXTENDED

        public static final StatusCode NOT_EXTENDED
      • NETWORK_AUTHENTICATION_REQUIRED

        public static final StatusCode NETWORK_AUTHENTICATION_REQUIRED
      • NETWORK_READ_TIMEOUT

        public static final StatusCode NETWORK_READ_TIMEOUT
      • NETWORK_CONNECT_TIMEOUT

        public static final StatusCode NETWORK_CONNECT_TIMEOUT
    • Method Detail

      • custom

        public static StatusCode custom​(int intValue,
                                        java.lang.String reason,
                                        java.lang.String defaultMessage,
                                        boolean isSuccess,
                                        boolean allowsEntity)
        Create a custom status code.
      • custom

        public static StatusCode custom​(int intValue,
                                        java.lang.String reason,
                                        java.lang.String defaultMessage)
        Create a custom status code.
      • get

        public static StatusCode get​(int intValue)
        Looks up a status-code by numeric code. Throws an exception if no such status-code is found.
      • lookup

        public static java.util.Optional<StatusCode> lookup​(int intValue)
        Looks up a status-code by numeric code and returns Some(code). Returns None otherwise.