Package ai.preferred.venom.storage
Class StorageRecord<T>
- java.lang.Object
-
- ai.preferred.venom.storage.StorageRecord<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStorageRecord.Builder<T>A builder for StorageRecord class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> StorageRecord.Builder<T>builder()Create an instance of builder.org.apache.http.entity.ContentTypegetContentType()longgetDateCreated()TgetId()StringgetMD5()Get md5 hash of the response content.Map<String,String>getRequestBody()Map<String,String>getRequestHeaders()Request.MethodgetRequestMethod()byte[]getResponseContent()org.apache.http.Header[]getResponseHeaders()intgetStatusCode()StringgetURL()
-
-
-
Method Detail
-
builder
public static <T> StorageRecord.Builder<T> builder()
Create an instance of builder.- Type Parameters:
T- the type of id- Returns:
- a new instance of builder
-
getId
public T getId()
-
getURL
public String getURL()
-
getRequestMethod
public Request.Method getRequestMethod()
- Specified by:
getRequestMethodin interfaceRecord<T>- Returns:
- Request type
-
getRequestHeaders
public Map<String,String> getRequestHeaders()
- Specified by:
getRequestHeadersin interfaceRecord<T>- Returns:
- map of request headers
-
getRequestBody
public Map<String,String> getRequestBody()
- Specified by:
getRequestBodyin interfaceRecord<T>- Returns:
- map of request body
-
getStatusCode
public int getStatusCode()
- Specified by:
getStatusCodein interfaceRecord<T>- Returns:
- status code
-
getResponseHeaders
public org.apache.http.Header[] getResponseHeaders()
- Specified by:
getResponseHeadersin interfaceRecord<T>- Returns:
- BaseResponse headers
-
getContentType
public org.apache.http.entity.ContentType getContentType()
- Specified by:
getContentTypein interfaceRecord<T>- Returns:
- ContentType of the content
-
getResponseContent
public byte[] getResponseContent()
- Specified by:
getResponseContentin interfaceRecord<T>- Returns:
- raw response file (uncompressed)
-
getDateCreated
public long getDateCreated()
- Specified by:
getDateCreatedin interfaceRecord<T>- Returns:
- valid timestamp if the record is stored, -1 otherwise
-
getMD5
public String getMD5()
Get md5 hash of the response content.- Returns:
- md5 hash of the response content
-
-