protected final <T> Promise<T> callAndParse(final ResponsePromise responsePromise, final ResponseHandler<T> responseHandler) { final Function<Response, T> transformFunction = toFunction(responseHandler); final ResponseTransformation<Object> responseTransformation = DefaultResponseTransformation.builder() .ok(transformFunction) .created(transformFunction) .others(AbstractAsynchronousRestClient.errorFunction()) .build(); return new DelegatingPromise(responsePromise.transform(responseTransformation)); }
protected final Promise<Void> call(final ResponsePromise responsePromise) { final ResponseTransformation<Object> responseTransformation = DefaultResponseTransformation.builder() .ok(constant((Void) null)) .created(constant((Void) null)) .noContent(constant((Void) null)) .others(AbstractAsynchronousRestClient.errorFunction()) .build(); return new DelegatingPromise(responsePromise.transform(responseTransformation)); }