Class ParseHttpResponse.Builder

  • Enclosing class:
    ParseHttpResponse

    public static final class ParseHttpResponse.Builder
    extends java.lang.Object
    Builder for ParseHttpResponse.
    • Constructor Detail

      • Builder

        public Builder()
        Creates an empty Builder.
      • Builder

        public Builder​(ParseHttpResponse response)
        Makes a new Builder based on the given ParseHttpResponse.
        Parameters:
        response - The ParseHttpResponse where the Builder's values come from.
    • Method Detail

      • setStatusCode

        public ParseHttpResponse.Builder setStatusCode​(int statusCode)
        Sets the status code of this Builder.
        Parameters:
        statusCode - The status code of this Builder.
        Returns:
        This Builder.
      • setContent

        public ParseHttpResponse.Builder setContent​(java.io.InputStream content)
        Sets the content of this Builder.
        Parameters:
        content - The content of this Builder.
        Returns:
        This Builder.
      • setTotalSize

        public ParseHttpResponse.Builder setTotalSize​(long totalSize)
        Sets the total size of this Builder.
        Parameters:
        totalSize - The total size of this Builder.
        Returns:
        This Builder.
      • setReasonPhrase

        public ParseHttpResponse.Builder setReasonPhrase​(java.lang.String reasonPhrase)
        Sets the reason phrase of this Builder.
        Parameters:
        reasonPhrase - The reason phrase of this Builder.
        Returns:
        This Builder.
      • setHeaders

        public ParseHttpResponse.Builder setHeaders​(java.util.Map<java.lang.String,​java.lang.String> headers)
        Sets headers of this Builder. All existing headers will be cleared.
        Parameters:
        headers - The headers of this Builder.
        Returns:
        This Builder.
      • addHeaders

        public ParseHttpResponse.Builder addHeaders​(java.util.Map<java.lang.String,​java.lang.String> headers)
        Adds headers to this Builder.
        Parameters:
        headers - The headers that need to be added.
        Returns:
        This Builder.
      • addHeader

        public ParseHttpResponse.Builder addHeader​(java.lang.String name,
                                                   java.lang.String value)
        Adds a header to this Builder.
        Parameters:
        name - The name of the header.
        value - The value of the header.
        Returns:
        This Builder.
      • setContentType

        public ParseHttpResponse.Builder setContentType​(java.lang.String contentType)
        Sets the content type of this Builder.
        Parameters:
        contentType - The Content-Type of this Builder.
        Returns:
        This Builder.