Interface ResponseParser<R>
- Type Parameters:
R- The expected return type on "right"/success cases.
- All Known Implementing Classes:
ResponseParserWithTransformation
public interface ResponseParser<R>
ResponseParser goal is to deal with the transformation of a plain json response into Either a
OperationFailure
or a concrete response.-
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)
-
Method Details
-
parseToEither
- Parameters:
response-HttpResponsewith string- Returns:
- Either R or the failure
-
parseErrorMessage
- Parameters:
statusCode- integer with the http status codebody- body in string representation- Returns:
- Either R or the failure
-