Class StatusLineHttpStatus

java.lang.Object
org.dmfs.httpessentials.status.StatusLineHttpStatus
All Implemented Interfaces:
HttpStatus

public final class StatusLineHttpStatus extends Object implements HttpStatus
An HttpStatus that's derived from an HTTP status line.

TODO: validate the given status line

  • Constructor Details

    • StatusLineHttpStatus

      public StatusLineHttpStatus(String statusLine)
      Creates an HttpStatus object from a given status line
      Parameters:
      statusLine - The status line.
  • Method Details

    • statusCode

      public int statusCode()
      Description copied from interface: HttpStatus
      Returns the status code.
      Specified by:
      statusCode in interface HttpStatus
      Returns:
    • reason

      public String reason()
      Description copied from interface: HttpStatus
      Returns the reason phrase of this status code.

      Note: the reason phrase doesn't contain the status code itself.

      Specified by:
      reason in interface HttpStatus
      Returns:
      The reason phrase or null if the status code is unknown.
    • isInformational

      public boolean isInformational()
      Description copied from interface: HttpStatus
      Returns whether this represents an informational status code.
      Specified by:
      isInformational in interface HttpStatus
      Returns:
      true if this represents an informational status code, false otherwise.
    • isSuccess

      public boolean isSuccess()
      Description copied from interface: HttpStatus
      Returns whether this status represents a success status code.
      Specified by:
      isSuccess in interface HttpStatus
      Returns:
      true if this represents a success status code, false otherwise.
    • isRedirect

      public boolean isRedirect()
      Description copied from interface: HttpStatus
      Returns whether this status represents a redirection status code.
      Specified by:
      isRedirect in interface HttpStatus
      Returns:
      true if this represents a redirection status code, false otherwise.
    • isClientError

      public boolean isClientError()
      Description copied from interface: HttpStatus
      Returns whether this status represents a client error status code.
      Specified by:
      isClientError in interface HttpStatus
      Returns:
      true if this represents a client error status code, false otherwise.
    • isServerError

      public boolean isServerError()
      Description copied from interface: HttpStatus
      Returns whether this status represents a server error status code.
      Specified by:
      isServerError in interface HttpStatus
      Returns:
      true if this represents a server error status code, false otherwise.
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface HttpStatus
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface HttpStatus
      Overrides:
      equals in class Object