Class UserPortalContentResponseTransformer
- java.lang.Object
-
- de.xima.fc.user_portal.api.provider.impl.UserPortalContentResponseTransformer
-
public class UserPortalContentResponseTransformer extends Object
- Since:
- 8.6.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> de.xima.fc.user_portal.api.provider.impl.ResponseTransformer<ApiResponse<T>,T>success()Creates a transformer that returns the result if the status code is 2xx, and throws and error otherwise.static <T> de.xima.fc.user_portal.api.provider.impl.ResponseTransformer<ApiResponse<T>,T>success(int nullCode, int... moreNullCodes)Creates a transformer that returns the result if the status code is 2xx,nullif the status code matches one of the given codes (such as 404), and throws and error otherwise.static <T,U>
de.xima.fc.user_portal.api.provider.impl.ResponseTransformer<ApiResponse<T>,U>success(de.xima.fc.user_portal.api.provider.impl.ResponseTransformer<T,U> mapper)Creates a transformer that applies the given mapper to the result if the status code is 2xx, and throws and error otherwise.static <T,U>
de.xima.fc.user_portal.api.provider.impl.ResponseTransformer<ApiResponse<T>,U>success(de.xima.fc.user_portal.api.provider.impl.ResponseTransformer<T,U> mapper, int statusCode, int... moreStatusCodes)Creates a transformer that applies the given mapper to the result if the status code is 2xx, returnsnullif the status code is one of the given status codems, and throws and error otherwise.
-
-
-
Method Detail
-
success
public static <T> de.xima.fc.user_portal.api.provider.impl.ResponseTransformer<ApiResponse<T>,T> success()
Creates a transformer that returns the result if the status code is 2xx, and throws and error otherwise.- Type Parameters:
T- Type of the response.- Returns:
- A transformer that returns the result on success or throws otherwise.
-
success
public static <T> de.xima.fc.user_portal.api.provider.impl.ResponseTransformer<ApiResponse<T>,T> success(int nullCode, int... moreNullCodes)
Creates a transformer that returns the result if the status code is 2xx,nullif the status code matches one of the given codes (such as 404), and throws and error otherwise.- Type Parameters:
T- Type of the response.- Returns:
- A transformer that returns the result on success, null for the given codes, and throws otherwise.
-
success
public static <T,U> de.xima.fc.user_portal.api.provider.impl.ResponseTransformer<ApiResponse<T>,U> success(de.xima.fc.user_portal.api.provider.impl.ResponseTransformer<T,U> mapper)
Creates a transformer that applies the given mapper to the result if the status code is 2xx, and throws and error otherwise.- Type Parameters:
T- Type of the response.- Returns:
- A transformer that applies the given mapper to the success result.
-
success
public static <T,U> de.xima.fc.user_portal.api.provider.impl.ResponseTransformer<ApiResponse<T>,U> success(de.xima.fc.user_portal.api.provider.impl.ResponseTransformer<T,U> mapper, int statusCode, int... moreStatusCodes)
Creates a transformer that applies the given mapper to the result if the status code is 2xx, returnsnullif the status code is one of the given status codems, and throws and error otherwise.- Type Parameters:
T- Type of the response.- Returns:
- A transformer that applies the given mapper to the success result.
-
-