Class StorageRecord.Builder<T>

  • Type Parameters:
    T - the type of id
    Enclosing class:
    StorageRecord<T>

    public static class StorageRecord.Builder<T>
    extends java.lang.Object
    A builder for StorageRecord class.
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • setId

        public final StorageRecord.Builder setId​(T id)
        Sets the id for the record.
        Parameters:
        id - id for the record
        Returns:
        this
      • setUrl

        public final StorageRecord.Builder setUrl​(java.lang.String url)
        Sets the url for the record.
        Parameters:
        url - url for the request
        Returns:
        this
      • setRequestMethod

        public final StorageRecord.Builder setRequestMethod​(Request.Method requestMethod)
        Sets the request method for the record.
        Parameters:
        requestMethod - method of the request
        Returns:
        this
      • setRequestHeaders

        public final StorageRecord.Builder setRequestHeaders​(java.util.Map<java.lang.String,​java.lang.String> requestHeaders)
        Sets the request headers for the record.
        Parameters:
        requestHeaders - headers of the request
        Returns:
        this
      • setRequestBody

        public final StorageRecord.Builder setRequestBody​(java.util.Map<java.lang.String,​java.lang.String> requestBody)
        Sets the request body for the record.
        Parameters:
        requestBody - body of the request
        Returns:
        this
      • setStatusCode

        public final StorageRecord.Builder setStatusCode​(int statusCode)
        Sets the response status code for the record.
        Parameters:
        statusCode - status code of the response
        Returns:
        this
      • setResponseHeaders

        public final StorageRecord.Builder setResponseHeaders​(org.apache.http.Header[] responseHeaders)
        Sets the response headers for the record.
        Parameters:
        responseHeaders - headers of the response
        Returns:
        this
      • setContentType

        public final StorageRecord.Builder setContentType​(org.apache.http.entity.ContentType contentType)
        Sets the response content type for the record.
        Parameters:
        contentType - content type of the response
        Returns:
        this
      • setResponseContent

        public final StorageRecord.Builder setResponseContent​(byte[] responseContent)
        Sets the response content for the record.
        Parameters:
        responseContent - content of the response
        Returns:
        this
      • setMD5

        public final StorageRecord.Builder setMD5​(java.lang.String md5)
        Sets the md5 hash of the response content for the record.
        Parameters:
        md5 - md5 hash of the response content
        Returns:
        this
      • setDateCreated

        public final StorageRecord.Builder setDateCreated​(long dateCreated)
        Sets the date the record was created.
        Parameters:
        dateCreated - date created of the record
        Returns:
        this
      • build

        public final StorageRecord<T> build()
        Builds the storage record with the details specified.
        Returns:
        an instance of StorageRecord.