Class ResponseParserWithTransformation<I,R>
java.lang.Object
cloud.quasarch.akash.impl.parsing.ResponseParserWithTransformation<I,R>
- Type Parameters:
I- the intermediary representation type, which is the representation of the jsonR- the final result object, after applying transformation.
- All Implemented Interfaces:
ResponseParser<R>
TODO Document!
TODO NO_OP transformation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.vavr.control.Either<OperationFailure,R> parseErrorMessage(int statusCode, String body) io.vavr.control.Either<OperationFailure,R> parseToEither(HttpResponse<String> response) transforms aHttpResponseinto a varv Either.
-
Constructor Details
-
ResponseParserWithTransformation
constructor- Parameters:
jsonModelClass- response type, classtransformation- transformation function, from http response type
-
-
Method Details
-
parseToEither
transforms aHttpResponseinto a varv Either.- Specified by:
parseToEitherin interfaceResponseParser<I>- Parameters:
response-HttpResponsewith string- Returns:
- Either
-
parseErrorMessage
- Specified by:
parseErrorMessagein interfaceResponseParser<I>- Parameters:
statusCode- integer with the http status codebody- body in string representation- Returns:
- Either R or the failure
-