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

io.vrap.rmf.base.client.http.NotFoundExceptionMiddleware Maven / Gradle / Ivy

There is a newer version: 17.17.0
Show newest version

package io.vrap.rmf.base.client.http;

import java.util.Set;
import java.util.function.Predicate;

import io.vrap.rmf.base.client.ApiHttpMethod;
import io.vrap.rmf.base.client.ApiHttpRequest;

/**
 * Middleware to convert a {@link io.vrap.rmf.base.client.error.NotFoundException} to a response with a null body value
 */
public interface NotFoundExceptionMiddleware extends Middleware {

    static NotFoundExceptionMiddleware of() {
        return new NotFoundExceptionMiddlewareImpl();
    }

    static NotFoundExceptionMiddleware of(final Set methods) {
        return new NotFoundExceptionMiddlewareImpl(apiHttpRequest -> methods.contains(apiHttpRequest.getMethod()));
    }

    static NotFoundExceptionMiddleware of(final Predicate requestPredicate) {
        return new NotFoundExceptionMiddlewareImpl(requestPredicate);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy