Class StatusLine


  • public class StatusLine
    extends java.lang.Object
    HTTP status line returned from an HTTP server.
    Since:
    1.19
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String mHttpVersion
      HTTP version.
      private java.lang.String mReasonPhrase
      Reason phrase.
      private int mStatusCode
      Status code.
      private java.lang.String mString
      String representation of this instance (= the raw status line).
    • Constructor Summary

      Constructors 
      Constructor Description
      StatusLine​(java.lang.String line)
      Constructor with a raw status line.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getHttpVersion()
      Get the HTTP version.
      java.lang.String getReasonPhrase()
      Get the reason phrase.
      int getStatusCode()
      Get the status code.
      java.lang.String toString()
      Get the string representation of this instance, which is equal to the raw status line.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • mHttpVersion

        private final java.lang.String mHttpVersion
        HTTP version.
      • mStatusCode

        private final int mStatusCode
        Status code.
      • mReasonPhrase

        private final java.lang.String mReasonPhrase
        Reason phrase.
      • mString

        private final java.lang.String mString
        String representation of this instance (= the raw status line).
    • Constructor Detail

      • StatusLine

        StatusLine​(java.lang.String line)
        Constructor with a raw status line.
        Parameters:
        line - A status line.
        Throws:
        java.lang.NullPointerException - line is null
        java.lang.IllegalArgumentException - The number of elements in line is less than 2.
        java.lang.NumberFormatException - Failed to parse the second element in line as an integer.
    • Method Detail

      • getHttpVersion

        public java.lang.String getHttpVersion()
        Get the HTTP version.
        Returns:
        The HTTP version. For example, "HTTP/1.1".
      • getStatusCode

        public int getStatusCode()
        Get the status code.
        Returns:
        The status code. For example, 404.
      • getReasonPhrase

        public java.lang.String getReasonPhrase()
        Get the reason phrase.
        Returns:
        The reason phrase. For example, "Not Found".
      • toString

        public java.lang.String toString()
        Get the string representation of this instance, which is equal to the raw status line.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The raw status line. For example, "HTTP/1.1 404 Not Found".