Package de.xima.fc.proma.provider
Class PromaResponse<T>
- java.lang.Object
-
- de.xima.fc.proma.provider.PromaResponse<T>
-
- Type Parameters:
T- Type of the result.
- All Implemented Interfaces:
IPromaResponse<T>
public final class PromaResponse<T> extends Object implements IPromaResponse<T>
POJO forIPromaResponse.- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> IPromaResponse<T>empty(int statusCode)static <T> IPromaResponse<T>of(int statusCode, T result)intstatusCode()Tvalue()
-
-
-
Method Detail
-
value
public T value()
- Specified by:
valuein interfaceIPromaResponse<T>- Returns:
- Transformed result of the response, usually from the HTTP response body.
-
statusCode
public int statusCode()
- Specified by:
statusCodein interfaceIPromaResponse<T>- Returns:
- Status code of the HTTP response.
-
empty
public static <T> IPromaResponse<T> empty(int statusCode)
- Type Parameters:
T- Type of the result.- Parameters:
statusCode- Status code of the HTTP response.- Returns:
- A new POJO with the given status code and a
nullresult.
-
of
public static <T> IPromaResponse<T> of(int statusCode, T result)
- Type Parameters:
T- Type of the result.- Parameters:
statusCode- Status code of the HTTP response.result- Transformed result of the response, usually from the HTTP response body.- Returns:
- A new POJO with the given data.
-
-