Build the client.

@param <T>        the type parameter
@param builder    the builder
@param clientType the client type
@return the client instance
171457
public <T> T build(final AwsClientBuilder builder, final Class<T> clientType) {
        val cfg = new ClientConfiguration();
        try {
            val localAddress = getSetting("localAddress");
            if (StringUtils.isNotBlank(localAddress)) {
                cfg.setLocalAddress(InetAddress.getByName(localAddress));
            }
        } catch (final Exception e) {
            LOGGER.error(e.getMessage(), e);
        }
        builder.withClientConfiguration(cfg);

        val key = getSetting("credentialAccessKey");
        val secret = getSetting("credentialSecretKey");
        val credentials = ChainingAWSCredentialsProvider.getInstance(key, secret);
        builder.withCredentials(credentials);

        var region = getSetting("region");
        val currentRegion = Regions.getCurrentRegion();
        if (currentRegion != null && StringUtils.isBlank(region)) {
            region = currentRegion.getName();
        }
        var regionOverride = getSetting("regionOverride");
        if (currentRegion != null && StringUtils.isNotBlank(regionOverride)) {
            regionOverride = currentRegion.getName();
        }
        val finalRegion = StringUtils.defaultIfBlank(regionOverride, region);
        if (StringUtils.isNotBlank(finalRegion)) {
            builder.withRegion(finalRegion);
        }

        val endpoint = getSetting("endpoint");
        if (StringUtils.isNotBlank(endpoint)) {
            builder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpoint, finalRegion));
        }

        val result = builder.build();
        return clientType.cast(result);
    }
164614
@Nonnull
	public static <T> LObjIntConsumer<T> objIntConsumerFrom(Consumer<LObjIntConsumerBuilder<T>> buildingFunction) {
		LObjIntConsumerBuilder builder = new LObjIntConsumerBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
1123388
public static <T extends Annotation> T create(Class<T> annotationType) {
    return new Builder<T>(annotationType).create();
  }
543453
@Nonnull
	public static <T> LOiToSrtFunction<T> oiToSrtFunctionFrom(Consumer<LOiToSrtFunctionBuilder<T>> buildingFunction) {
		LOiToSrtFunctionBuilder builder = new LOiToSrtFunctionBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
881065
@Nonnull
	public static <T> BinaryOperator<T> binaryOperatorFrom(Consumer<BinaryOperatorBuilder<T>> buildingFunction) {
		BinaryOperatorBuilder builder = new BinaryOperatorBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
203712
public static ClusterClientOptions.Builder builder(ClientOptions clientOptions) {

        LettuceAssert.notNull(clientOptions, "ClientOptions must not be null");

        if (clientOptions instanceof ClusterClientOptions) {
            return ((ClusterClientOptions) clientOptions).mutate();
        }

        Builder builder = new Builder();
        builder.autoReconnect(clientOptions.isAutoReconnect()).bufferUsageRatio(clientOptions.getBufferUsageRatio())
                .cancelCommandsOnReconnectFailure(clientOptions.isCancelCommandsOnReconnectFailure())
                .disconnectedBehavior(clientOptions.getDisconnectedBehavior())
                .publishOnScheduler(clientOptions.isPublishOnScheduler())
                .pingBeforeActivateConnection(clientOptions.isPingBeforeActivateConnection())
                .requestQueueSize(clientOptions.getRequestQueueSize()).socketOptions(clientOptions.getSocketOptions())
                .sslOptions(clientOptions.getSslOptions())
                .suspendReconnectOnProtocolFailure(clientOptions.isSuspendReconnectOnProtocolFailure())
                .timeoutOptions(clientOptions.getTimeoutOptions());

        return builder;
    }
254542
@Nonnull
	public static <T1, T2> BiConsumer<T1, T2> biConsumerFrom(Consumer<BiConsumerBuilder<T1, T2>> buildingFunction) {
		BiConsumerBuilder builder = new BiConsumerBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
459222
public Datatype.Builder setBuilderFactory(BuilderFactory builderFactory) {
    this.builderFactory = Objects.requireNonNull(builderFactory);
    return (Datatype.Builder) this;
  }
15726
@Nonnull
	public static <T> ToIntFunction<T> toIntFunctionFrom(Consumer<ToIntFunctionBuilder<T>> buildingFunction) {
		ToIntFunctionBuilder builder = new ToIntFunctionBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
885711
@Override
  public <T> ServiceBuilder service(Class<T> type)
  {
    Key<?> key = Key.of(type, ServiceImpl.class);

    return service(key, type);
  }
709501
@Nonnull
	public static LByteToFltFunction byteToFltFunctionFrom(Consumer<LByteToFltFunctionBuilder> buildingFunction) {
		LByteToFltFunctionBuilder builder = new LByteToFltFunctionBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
671886
public BuildableType.Builder type(Type type) {
    this.type = Objects.requireNonNull(type);
    _unsetProperties.remove(Property.TYPE);
    return (BuildableType.Builder) this;
  }
1307584
public <T extends Client<? extends Options, ? extends OptionsBuilder, ? extends RequestBuilder>> T newClient(Class<? extends Client> clientClass) {
        Client client;
        try {
            client = clientClass.newInstance();
            return (T) client;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
732616
@Nonnull
	public static <T> LToIntFunction<T> toIntFunctionFrom(Consumer<LToIntFunctionBuilder<T>> buildingFunction) {
		LToIntFunctionBuilder builder = new LToIntFunctionBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
435794
public <T extends AbstractGoogleJsonClient.Builder> T fromApiKey(T builder, String apiKey) {
    Preconditions.checkNotNull(builder);
    Preconditions.checkNotNull(apiKey);
    return prepareBuilder(builder, null, new CommonGoogleClientRequestInitializer(apiKey));
  }
862757
@Nonnull
	public static <T1, T2, R> LObjIntObjFunction<T1, T2, R> objIntObjFunctionFrom(Consumer<LObjIntObjFunctionBuilder<T1, T2, R>> buildingFunction) {
		LObjIntObjFunctionBuilder builder = new LObjIntObjFunctionBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
1177600
@Nonnull
	public static IntSupplier intSupplierFrom(Consumer<IntSupplierBuilder> buildingFunction) {
		IntSupplierBuilder builder = new IntSupplierBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}