class ResponseHandlers {

    public static <T> HttpClient.ResponseHandler<T> multipartFormDataResponseHandler(Class<T> bodyClass) {
        return (statusCode, responseBody, responseHeaders) -> {
            if (statusCode != 200) {
                throw responseException(statusCode,
                    new PushbackInputStream(responseBody),
                    responseHeaders,
                    ResponseHandlers::buildErrorResponseFromString);
            }
            try {
                return parseResponseIntoObject(bodyClass, responseBody, responseHeaders);
            } catch (ReflectiveOperationException | IntrospectionException e) {
                throw new Xs2aAdapterException(e);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        };
    }

    private  ResponseHandlers();

}