Package ai.preferred.venom.storage
Class StorageRecord.Builder<T>
- java.lang.Object
-
- ai.preferred.venom.storage.StorageRecord.Builder<T>
-
- Type Parameters:
T
- the type of id
- Enclosing class:
- StorageRecord<T>
public static final class StorageRecord.Builder<T> extends Object
A builder for StorageRecord class.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StorageRecord<T>
build()
Builds the storage record with the details specified.StorageRecord.Builder<T>
setContentType(org.apache.http.entity.ContentType contentType)
Sets the response content type for the record.StorageRecord.Builder<T>
setDateCreated(long dateCreated)
Sets the date the record was created.StorageRecord.Builder<T>
setMD5(String md5)
Sets the md5 hash of the response content for the record.StorageRecord.Builder<T>
setRequestBody(Map<String,String> requestBody)
Sets the request body for the record.StorageRecord.Builder<T>
setRequestHeaders(Map<String,String> requestHeaders)
Sets the request headers for the record.StorageRecord.Builder<T>
setRequestMethod(Request.Method requestMethod)
Sets the request method for the record.StorageRecord.Builder<T>
setResponseContent(byte[] responseContent)
Sets the response content for the record.StorageRecord.Builder<T>
setResponseHeaders(org.apache.http.Header[] responseHeaders)
Sets the response headers for the record.StorageRecord.Builder<T>
setStatusCode(int statusCode)
Sets the response status code for the record.StorageRecord.Builder<T>
setUrl(String url)
Sets the url for the record.
-
-
-
Method Detail
-
setUrl
public StorageRecord.Builder<T> setUrl(String url)
Sets the url for the record.- Parameters:
url
- url for the request- Returns:
- this
-
setRequestMethod
public StorageRecord.Builder<T> setRequestMethod(Request.Method requestMethod)
Sets the request method for the record.- Parameters:
requestMethod
- method of the request- Returns:
- this
-
setRequestHeaders
public StorageRecord.Builder<T> setRequestHeaders(Map<String,String> requestHeaders)
Sets the request headers for the record.- Parameters:
requestHeaders
- headers of the request- Returns:
- this
-
setRequestBody
public StorageRecord.Builder<T> setRequestBody(Map<String,String> requestBody)
Sets the request body for the record.- Parameters:
requestBody
- body of the request- Returns:
- this
-
setStatusCode
public StorageRecord.Builder<T> setStatusCode(int statusCode)
Sets the response status code for the record.- Parameters:
statusCode
- status code of the response- Returns:
- this
-
setResponseHeaders
public StorageRecord.Builder<T> setResponseHeaders(org.apache.http.Header[] responseHeaders)
Sets the response headers for the record.- Parameters:
responseHeaders
- headers of the response- Returns:
- this
-
setContentType
public StorageRecord.Builder<T> 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 StorageRecord.Builder<T> setResponseContent(byte[] responseContent)
Sets the response content for the record.- Parameters:
responseContent
- content of the response- Returns:
- this
-
setMD5
public StorageRecord.Builder<T> setMD5(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 StorageRecord.Builder<T> setDateCreated(long dateCreated)
Sets the date the record was created.- Parameters:
dateCreated
- date created of the record- Returns:
- this
-
build
public StorageRecord<T> build()
Builds the storage record with the details specified.- Returns:
- an instance of StorageRecord.
-
-