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 class StorageRecord.Builder<T> extends java.lang.ObjectA builder for StorageRecord class.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
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.BuildersetContentType(org.apache.http.entity.ContentType contentType)Sets the response content type for the record.StorageRecord.BuildersetDateCreated(long dateCreated)Sets the date the record was created.StorageRecord.BuildersetId(T id)Sets the id for the record.StorageRecord.BuildersetMD5(java.lang.String md5)Sets the md5 hash of the response content for the record.StorageRecord.BuildersetRequestBody(java.util.Map<java.lang.String,java.lang.String> requestBody)Sets the request body for the record.StorageRecord.BuildersetRequestHeaders(java.util.Map<java.lang.String,java.lang.String> requestHeaders)Sets the request headers for the record.StorageRecord.BuildersetRequestMethod(Request.Method requestMethod)Sets the request method for the record.StorageRecord.BuildersetResponseContent(byte[] responseContent)Sets the response content for the record.StorageRecord.BuildersetResponseHeaders(org.apache.http.Header[] responseHeaders)Sets the response headers for the record.StorageRecord.BuildersetStatusCode(int statusCode)Sets the response status code for the record.StorageRecord.BuildersetUrl(java.lang.String url)Sets the url for the record.
-
-
-
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.
-
-