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

spring.turbo.module.webcli.annotation.RestClientSupplier Maven / Gradle / Ivy

There is a newer version: 3.3.5
Show newest version
package spring.turbo.module.webcli.annotation;

import org.springframework.web.client.RestClient;
import spring.turbo.module.webcli.error.NoopResponseErrorHandler;

import java.util.function.Supplier;

/**
 * @author 应卓
 * @since 3.3.1
 */
@FunctionalInterface
public interface RestClientSupplier extends Supplier {

    @Override
    public RestClient get();

    // -----------------------------------------------------------------------------------------------------------------

    public static class Default implements RestClientSupplier {
        public RestClient get() {
            return RestClient.builder()
                    .defaultStatusHandler(NoopResponseErrorHandler.getInstance())
                    .build();
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy