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 Details

    • parseToEither

      io.vavr.control.Either<OperationFailure,R> parseToEither(HttpResponse<String> response)
      Parameters:
      response - HttpResponse with string
      Returns:
      Either R or the failure
    • parseErrorMessage

      io.vavr.control.Either<OperationFailure,R> parseErrorMessage(int statusCode, String body)
      Parameters:
      statusCode - integer with the http status code
      body - body in string representation
      Returns:
      Either R or the failure