From e07518f05c04850948a0f3ab932124087d803139 Mon Sep 17 00:00:00 2001 From: atakavci Date: Tue, 15 Oct 2024 10:25:46 +0300 Subject: [PATCH] format by hbase-formatter --- .../java/redis/clients/jedis/JedisPooled.java | 216 ++++++++++-------- 1 file changed, 116 insertions(+), 100 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisPooled.java b/src/main/java/redis/clients/jedis/JedisPooled.java index c3429319e7..164c72d93b 100644 --- a/src/main/java/redis/clients/jedis/JedisPooled.java +++ b/src/main/java/redis/clients/jedis/JedisPooled.java @@ -66,13 +66,14 @@ public JedisPooled(final String host, final int port, final boolean ssl) { public JedisPooled(final String host, final int port, final boolean ssl, final SSLSocketFactory sslSocketFactory, final SSLParameters sslParameters, final HostnameVerifier hostnameVerifier) { - this(new HostAndPort(host, port), DefaultJedisClientConfig.builder().ssl(ssl) - .sslSocketFactory(sslSocketFactory).sslParameters(sslParameters) - .hostnameVerifier(hostnameVerifier).build()); + this(new HostAndPort(host, port), + DefaultJedisClientConfig.builder().ssl(ssl).sslSocketFactory(sslSocketFactory) + .sslParameters(sslParameters).hostnameVerifier(hostnameVerifier).build()); } public JedisPooled(final String host, final int port, final String user, final String password) { - this(new HostAndPort(host, port), DefaultJedisClientConfig.builder().user(user).password(password).build()); + this(new HostAndPort(host, port), + DefaultJedisClientConfig.builder().user(user).password(password).build()); } public JedisPooled(final HostAndPort hostAndPort, final JedisClientConfig clientConfig) { @@ -80,12 +81,14 @@ public JedisPooled(final HostAndPort hostAndPort, final JedisClientConfig client } @Experimental - public JedisPooled(final HostAndPort hostAndPort, final JedisClientConfig clientConfig, CacheConfig cacheConfig) { + public JedisPooled(final HostAndPort hostAndPort, final JedisClientConfig clientConfig, + CacheConfig cacheConfig) { this(hostAndPort, clientConfig, CacheFactory.getCache(cacheConfig)); } @Experimental - public JedisPooled(final HostAndPort hostAndPort, final JedisClientConfig clientConfig, Cache clientSideCache) { + public JedisPooled(final HostAndPort hostAndPort, final JedisClientConfig clientConfig, + Cache clientSideCache) { super(hostAndPort, clientConfig, clientSideCache); } @@ -146,144 +149,148 @@ public JedisPooled(final GenericObjectPoolConfig poolConfig, final S } public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, - final int port, final int timeout, final boolean ssl, - final SSLSocketFactory sslSocketFactory, final SSLParameters sslParameters, - final HostnameVerifier hostnameVerifier) { + final int port, final int timeout, final boolean ssl, final SSLSocketFactory sslSocketFactory, + final SSLParameters sslParameters, final HostnameVerifier hostnameVerifier) { this(poolConfig, host, port, timeout, null, ssl, sslSocketFactory, sslParameters, hostnameVerifier); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - int timeout, final String password) { + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, int timeout, final String password) { this(poolConfig, host, port, timeout, password, Protocol.DEFAULT_DATABASE); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - int timeout, final String password, final boolean ssl) { + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, int timeout, final String password, final boolean ssl) { this(poolConfig, host, port, timeout, password, Protocol.DEFAULT_DATABASE, ssl); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - int timeout, final String password, final boolean ssl, final SSLSocketFactory sslSocketFactory, - final SSLParameters sslParameters, final HostnameVerifier hostnameVerifier) { - this(poolConfig, host, port, timeout, password, Protocol.DEFAULT_DATABASE, ssl, sslSocketFactory, - sslParameters, hostnameVerifier); + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, int timeout, final String password, final boolean ssl, + final SSLSocketFactory sslSocketFactory, final SSLParameters sslParameters, + final HostnameVerifier hostnameVerifier) { + this(poolConfig, host, port, timeout, password, Protocol.DEFAULT_DATABASE, ssl, + sslSocketFactory, sslParameters, hostnameVerifier); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - int timeout, final String user, final String password) { + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, int timeout, final String user, final String password) { this(poolConfig, host, port, timeout, user, password, Protocol.DEFAULT_DATABASE); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - int timeout, final String user, final String password, final boolean ssl) { + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, int timeout, final String user, final String password, final boolean ssl) { this(poolConfig, host, port, timeout, user, password, Protocol.DEFAULT_DATABASE, ssl); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - int timeout, final String password, final int database) { + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, int timeout, final String password, final int database) { this(poolConfig, host, port, timeout, password, database, null); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - int timeout, final String password, final int database, final boolean ssl) { + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, int timeout, final String password, final int database, final boolean ssl) { this(poolConfig, host, port, timeout, password, database, null, ssl); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - int timeout, final String password, final int database, final boolean ssl, + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, int timeout, final String password, final int database, final boolean ssl, final SSLSocketFactory sslSocketFactory, final SSLParameters sslParameters, final HostnameVerifier hostnameVerifier) { this(poolConfig, host, port, timeout, password, database, null, ssl, sslSocketFactory, sslParameters, hostnameVerifier); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - int timeout, final String user, final String password, final int database) { + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, int timeout, final String user, final String password, final int database) { this(poolConfig, host, port, timeout, user, password, database, null); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - int timeout, final String user, final String password, final int database, final boolean ssl) { + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, int timeout, final String user, final String password, final int database, + final boolean ssl) { this(poolConfig, host, port, timeout, user, password, database, null, ssl); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - int timeout, final String password, final int database, final String clientName) { + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, int timeout, final String password, final int database, final String clientName) { this(poolConfig, host, port, timeout, timeout, password, database, clientName); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - int timeout, final String password, final int database, final String clientName, + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, int timeout, final String password, final int database, final String clientName, final boolean ssl) { this(poolConfig, host, port, timeout, timeout, password, database, clientName, ssl); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - int timeout, final String password, final int database, final String clientName, - final boolean ssl, final SSLSocketFactory sslSocketFactory, - final SSLParameters sslParameters, final HostnameVerifier hostnameVerifier) { + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, int timeout, final String password, final int database, final String clientName, + final boolean ssl, final SSLSocketFactory sslSocketFactory, final SSLParameters sslParameters, + final HostnameVerifier hostnameVerifier) { this(poolConfig, host, port, timeout, timeout, password, database, clientName, ssl, sslSocketFactory, sslParameters, hostnameVerifier); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - int timeout, final String user, final String password, final int database, + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, int timeout, final String user, final String password, final int database, final String clientName) { this(poolConfig, host, port, timeout, timeout, user, password, database, clientName); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - int timeout, final String user, final String password, final int database, + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, int timeout, final String user, final String password, final int database, final String clientName, final boolean ssl) { this(poolConfig, host, port, timeout, timeout, user, password, database, clientName, ssl); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - final int connectionTimeout, final int soTimeout, final String password, final int database, - final String clientName) { - this(poolConfig, host, port, connectionTimeout, soTimeout, null, password, database, clientName); + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, final int connectionTimeout, final int soTimeout, final String password, + final int database, final String clientName) { + this(poolConfig, host, port, connectionTimeout, soTimeout, null, password, database, + clientName); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - final int connectionTimeout, final int soTimeout, final String password, final int database, - final String clientName, final boolean ssl) { + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, final int connectionTimeout, final int soTimeout, final String password, + final int database, final String clientName, final boolean ssl) { this(poolConfig, host, port, connectionTimeout, soTimeout, password, database, clientName, ssl, null, null, null); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - final int connectionTimeout, final int soTimeout, final String password, final int database, - final String clientName, final boolean ssl, final SSLSocketFactory sslSocketFactory, - final SSLParameters sslParameters, final HostnameVerifier hostnameVerifier) { + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, final int connectionTimeout, final int soTimeout, final String password, + final int database, final String clientName, final boolean ssl, + final SSLSocketFactory sslSocketFactory, final SSLParameters sslParameters, + final HostnameVerifier hostnameVerifier) { this(poolConfig, host, port, connectionTimeout, soTimeout, null, password, database, clientName, ssl, sslSocketFactory, sslParameters, hostnameVerifier); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - final int connectionTimeout, final int soTimeout, final String user, final String password, - final int database, final String clientName) { - this(poolConfig, host, port, connectionTimeout, soTimeout, 0, user, password, database, clientName); + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, final int connectionTimeout, final int soTimeout, final String user, + final String password, final int database, final String clientName) { + this(poolConfig, host, port, connectionTimeout, soTimeout, 0, user, password, database, + clientName); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - final int connectionTimeout, final int soTimeout, final String user, final String password, - final int database, final String clientName, final boolean ssl) { + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, final int connectionTimeout, final int soTimeout, final String user, + final String password, final int database, final String clientName, final boolean ssl) { this(poolConfig, host, port, connectionTimeout, soTimeout, user, password, database, clientName, ssl, null, null, null); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - final int connectionTimeout, final int soTimeout, final String user, final String password, - final int database, final String clientName, final boolean ssl, + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, final int connectionTimeout, final int soTimeout, final String user, + final String password, final int database, final String clientName, final boolean ssl, final SSLSocketFactory sslSocketFactory, final SSLParameters sslParameters, final HostnameVerifier hostnameVerifier) { this(poolConfig, host, port, connectionTimeout, soTimeout, 0, user, password, database, clientName, ssl, sslSocketFactory, sslParameters, hostnameVerifier); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - final int connectionTimeout, final int soTimeout, final int infiniteSoTimeout, + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, final int connectionTimeout, final int soTimeout, final int infiniteSoTimeout, final String password, final int database, final String clientName, final boolean ssl, final SSLSocketFactory sslSocketFactory, final SSLParameters sslParameters, final HostnameVerifier hostnameVerifier) { @@ -291,22 +298,25 @@ public JedisPooled(final GenericObjectPoolConfig poolConfig, final S database, clientName, ssl, sslSocketFactory, sslParameters, hostnameVerifier); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - final int connectionTimeout, final int soTimeout, final int infiniteSoTimeout, + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, final int connectionTimeout, final int soTimeout, final int infiniteSoTimeout, final String user, final String password, final int database, final String clientName) { - this(new HostAndPort(host, port), DefaultJedisClientConfig.create(connectionTimeout, soTimeout, - infiniteSoTimeout, user, password, database, clientName, false, null, null, null, null), + this( + new HostAndPort(host, port), DefaultJedisClientConfig.create(connectionTimeout, soTimeout, + infiniteSoTimeout, user, password, database, clientName, false, null, null, null, null), poolConfig); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, int port, - final int connectionTimeout, final int soTimeout, final int infiniteSoTimeout, final String user, - final String password, final int database, final String clientName, final boolean ssl, - final SSLSocketFactory sslSocketFactory, final SSLParameters sslParameters, + public JedisPooled(final GenericObjectPoolConfig poolConfig, final String host, + int port, final int connectionTimeout, final int soTimeout, final int infiniteSoTimeout, + final String user, final String password, final int database, final String clientName, + final boolean ssl, final SSLSocketFactory sslSocketFactory, final SSLParameters sslParameters, final HostnameVerifier hostnameVerifier) { - this(new HostAndPort(host, port), DefaultJedisClientConfig.create(connectionTimeout, soTimeout, - infiniteSoTimeout, user, password, database, clientName, ssl, sslSocketFactory, sslParameters, - hostnameVerifier, null), poolConfig); + this(new HostAndPort(host, port), + DefaultJedisClientConfig.create(connectionTimeout, soTimeout, infiniteSoTimeout, user, + password, database, clientName, ssl, sslSocketFactory, sslParameters, hostnameVerifier, + null), + poolConfig); } public JedisPooled(final URI uri) { @@ -346,8 +356,8 @@ public JedisPooled(final GenericObjectPoolConfig poolConfig, final U } public JedisPooled(final GenericObjectPoolConfig poolConfig, final URI uri, - final int timeout, final SSLSocketFactory sslSocketFactory, - final SSLParameters sslParameters, final HostnameVerifier hostnameVerifier) { + final int timeout, final SSLSocketFactory sslSocketFactory, final SSLParameters sslParameters, + final HostnameVerifier hostnameVerifier) { this(poolConfig, uri, timeout, timeout, sslSocketFactory, sslParameters, hostnameVerifier); } @@ -359,60 +369,66 @@ public JedisPooled(final GenericObjectPoolConfig poolConfig, final U public JedisPooled(final GenericObjectPoolConfig poolConfig, final URI uri, final int connectionTimeout, final int soTimeout, final SSLSocketFactory sslSocketFactory, final SSLParameters sslParameters, final HostnameVerifier hostnameVerifier) { - this(poolConfig, uri, connectionTimeout, soTimeout, 0, sslSocketFactory, sslParameters, hostnameVerifier); + this(poolConfig, uri, connectionTimeout, soTimeout, 0, sslSocketFactory, sslParameters, + hostnameVerifier); } public JedisPooled(final GenericObjectPoolConfig poolConfig, final URI uri, final int connectionTimeout, final int soTimeout, final int infiniteSoTimeout, final SSLSocketFactory sslSocketFactory, final SSLParameters sslParameters, final HostnameVerifier hostnameVerifier) { - this(new HostAndPort(uri.getHost(), uri.getPort()), DefaultJedisClientConfig.builder() - .connectionTimeoutMillis(connectionTimeout).socketTimeoutMillis(soTimeout) - .blockingSocketTimeoutMillis(infiniteSoTimeout).user(JedisURIHelper.getUser(uri)) - .password(JedisURIHelper.getPassword(uri)).database(JedisURIHelper.getDBIndex(uri)) - .protocol(JedisURIHelper.getRedisProtocol(uri)).ssl(JedisURIHelper.isRedisSSLScheme(uri)) - .sslSocketFactory(sslSocketFactory).sslParameters(sslParameters) - .hostnameVerifier(hostnameVerifier).build(), poolConfig); + this(new HostAndPort(uri.getHost(), uri.getPort()), + DefaultJedisClientConfig.builder().connectionTimeoutMillis(connectionTimeout) + .socketTimeoutMillis(soTimeout).blockingSocketTimeoutMillis(infiniteSoTimeout) + .user(JedisURIHelper.getUser(uri)).password(JedisURIHelper.getPassword(uri)) + .database(JedisURIHelper.getDBIndex(uri)).protocol(JedisURIHelper.getRedisProtocol(uri)) + .ssl(JedisURIHelper.isRedisSSLScheme(uri)).sslSocketFactory(sslSocketFactory) + .sslParameters(sslParameters).hostnameVerifier(hostnameVerifier).build(), + poolConfig); } - public JedisPooled(final HostAndPort hostAndPort, final GenericObjectPoolConfig poolConfig) { + public JedisPooled(final HostAndPort hostAndPort, + final GenericObjectPoolConfig poolConfig) { this(hostAndPort, DefaultJedisClientConfig.builder().build(), poolConfig); } - public JedisPooled(final GenericObjectPoolConfig poolConfig, final HostAndPort hostAndPort, - final JedisClientConfig clientConfig) { + public JedisPooled(final GenericObjectPoolConfig poolConfig, + final HostAndPort hostAndPort, final JedisClientConfig clientConfig) { this(hostAndPort, clientConfig, poolConfig); } public JedisPooled(final HostAndPort hostAndPort, final JedisClientConfig clientConfig, final GenericObjectPoolConfig poolConfig) { - super(new PooledConnectionProvider(hostAndPort, clientConfig, poolConfig), clientConfig.getRedisProtocol()); + super(new PooledConnectionProvider(hostAndPort, clientConfig, poolConfig), + clientConfig.getRedisProtocol()); } @Experimental - public JedisPooled(final HostAndPort hostAndPort, final JedisClientConfig clientConfig, CacheConfig cacheConfig, - final GenericObjectPoolConfig poolConfig) { + public JedisPooled(final HostAndPort hostAndPort, final JedisClientConfig clientConfig, + CacheConfig cacheConfig, final GenericObjectPoolConfig poolConfig) { this(hostAndPort, clientConfig, CacheFactory.getCache(cacheConfig), poolConfig); } @Experimental - public JedisPooled(final HostAndPort hostAndPort, final JedisClientConfig clientConfig, Cache clientSideCache, - final GenericObjectPoolConfig poolConfig) { + public JedisPooled(final HostAndPort hostAndPort, final JedisClientConfig clientConfig, + Cache clientSideCache, final GenericObjectPoolConfig poolConfig) { super(new PooledConnectionProvider(hostAndPort, clientConfig, clientSideCache, poolConfig), clientConfig.getRedisProtocol(), clientSideCache); } public JedisPooled(final GenericObjectPoolConfig poolConfig, final JedisSocketFactory jedisSocketFactory, final JedisClientConfig clientConfig) { - super(new PooledConnectionProvider(new ConnectionFactory(jedisSocketFactory, clientConfig), poolConfig), - clientConfig.getRedisProtocol()); + super(new PooledConnectionProvider(new ConnectionFactory(jedisSocketFactory, clientConfig), + poolConfig), clientConfig.getRedisProtocol()); } - public JedisPooled(GenericObjectPoolConfig poolConfig, PooledObjectFactory factory) { + public JedisPooled(GenericObjectPoolConfig poolConfig, + PooledObjectFactory factory) { this(factory, poolConfig); } - public JedisPooled(PooledObjectFactory factory, GenericObjectPoolConfig poolConfig) { + public JedisPooled(PooledObjectFactory factory, + GenericObjectPoolConfig poolConfig) { this(new PooledConnectionProvider(factory, poolConfig)); }