ClientBuilder extends AbstractClientOptionsBuilder { public <T> T build(Class<T> clientType) { requireNonNull(clientType, "clientType"); final Object client; final ClientOptions options = buildOptions(); final ClientFactory factory = options.factory(); if (uri != null) { client = factory.newClient(ClientBuilderParams.of(uri, clientType, options)); } else { assert endpointGroup != null; client = factory.newClient(ClientBuilderParams.of(scheme, endpointGroup, path, clientType, options)); } @SuppressWarnings("unchecked") final T cast = (T) client; return cast; } ClientBuilder(URI uri);   ClientBuilder(Scheme scheme, EndpointGroup endpointGroup, @Nullable String path); T build(Class<T> clientType); @Override ClientBuilder options(ClientOptions options); @Override ClientBuilder options(ClientOptionValue<?>... options); @Override ClientBuilder options(Iterable<ClientOptionValue<?>> options); @Override ClientBuilder option(ClientOption<T> option, T value); @Override ClientBuilder option(ClientOptionValue<T> optionValue); @Override ClientBuilder factory(ClientFactory factory); @Override ClientBuilder writeTimeout(Duration writeTimeout); @Override ClientBuilder writeTimeoutMillis(long writeTimeoutMillis); @Override ClientBuilder responseTimeout(Duration responseTimeout); @Override ClientBuilder responseTimeoutMillis(long responseTimeoutMillis); @Override ClientBuilder maxResponseLength(long maxResponseLength); @Override ClientBuilder requestIdGenerator(Supplier<RequestId> requestIdGenerator); @Override ClientBuilder endpointRemapper(
            Function<? super Endpoint, ? extends EndpointGroup> endpointRemapper); @Override ClientBuilder decorator(
            Function<? super HttpClient, ? extends HttpClient> decorator); @Override ClientBuilder decorator(DecoratingHttpClientFunction decorator); @Override ClientBuilder clearDecorators(); @Override ClientBuilder rpcDecorator(
            Function<? super RpcClient, ? extends RpcClient> decorator); @Override ClientBuilder rpcDecorator(DecoratingRpcClientFunction decorator); @Override ClientBuilder addHeader(CharSequence name, Object value); @Override ClientBuilder addHeaders(
            Iterable<? extends Entry<? extends CharSequence, ?>> headers); @Override ClientBuilder setHeader(CharSequence name, Object value); @Override ClientBuilder setHeaders(
            Iterable<? extends Entry<? extends CharSequence, ?>> headers); @Override ClientBuilder auth(BasicToken token); @Override ClientBuilder auth(OAuth1aToken token); @Override ClientBuilder auth(OAuth2Token token);  }
@Test void uriWithNonePlusProtocol() throws Exception { final WebClient client = Clients.builder("none+https: assertThat(client.uri().toString()).isEqualTo("https: }
@Test void uriWithoutNone() { final WebClient client = Clients.builder("https: assertThat(client.uri().toString()).isEqualTo("https: }
@Test void endpointWithoutPath() { final WebClient client = Clients.builder("http", Endpoint.of("127.0.0.1")) .build(WebClient.class); assertThat(client.uri().toString()).isEqualTo("http: }
@Test void endpointWithPath() { final WebClient client = Clients.builder("http", Endpoint.of("127.0.0.1"), "/foo") .build(WebClient.class); assertThat(client.uri().toString()).isEqualTo("http: }