All Downloads are FREE. Search and download functionalities are using the official Maven repository.

reactivefeign.rx3.client.statushandler.Rx3ReactiveStatusHandler Maven / Gradle / Ivy

package reactivefeign.rx3.client.statushandler;

import reactivefeign.client.ReactiveHttpResponse;
import reactivefeign.client.statushandler.ReactiveStatusHandler;
import reactor.core.publisher.Mono;

import static reactor.adapter.rxjava.RxJava3Adapter.singleToMono;

public class Rx3ReactiveStatusHandler implements ReactiveStatusHandler {

	private final Rx3StatusHandler statusHandler;

	public Rx3ReactiveStatusHandler(Rx3StatusHandler statusHandler) {
		this.statusHandler = statusHandler;
	}

	@Override
	public boolean shouldHandle(int status) {
		return statusHandler.shouldHandle(status);
	}

	@Override
	public Mono decode(String methodKey, ReactiveHttpResponse response) {
		return singleToMono(statusHandler.decode(methodKey, response));
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy