diff --git a/src/main/java/redis/clients/jedis/Connection.java b/src/main/java/redis/clients/jedis/Connection.java index 02a771497d..6919dc949b 100644 --- a/src/main/java/redis/clients/jedis/Connection.java +++ b/src/main/java/redis/clients/jedis/Connection.java @@ -13,7 +13,7 @@ import redis.clients.jedis.Protocol.Command; import redis.clients.jedis.Protocol.Keyword; -import redis.clients.jedis.args.ClientAttrOption; +import redis.clients.jedis.args.ClientAttributeOption; import redis.clients.jedis.args.Rawable; import redis.clients.jedis.commands.ProtocolCommand; import redis.clients.jedis.exceptions.JedisConnectionException; @@ -372,13 +372,13 @@ private void initializeFromClientConfig(JedisClientConfig config) { String libName = JedisMetaInfo.getArtifactId(); if (libName != null) { fireAndForgetMsg.add(new CommandArguments(Command.CLIENT).add(Keyword.SETINFO) - .add(ClientAttrOption.LIB_NAME.getRaw()).add(libName)); + .add(ClientAttributeOption.LIB_NAME.getRaw()).add(libName)); } String libVersion = JedisMetaInfo.getVersion(); if (libVersion != null) { fireAndForgetMsg.add(new CommandArguments(Command.CLIENT).add(Keyword.SETINFO) - .add(ClientAttrOption.LIB_VER.getRaw()).add(libVersion)); + .add(ClientAttributeOption.LIB_VER.getRaw()).add(libVersion)); } for (CommandArguments arg : fireAndForgetMsg) { diff --git a/src/main/java/redis/clients/jedis/Jedis.java b/src/main/java/redis/clients/jedis/Jedis.java index 085b68c53c..984552daee 100644 --- a/src/main/java/redis/clients/jedis/Jedis.java +++ b/src/main/java/redis/clients/jedis/Jedis.java @@ -4232,7 +4232,7 @@ public byte[] clientInfoBinary() { } @Override - public String clientSetInfo(ClientAttrOption attr, byte[] value) { + public String clientSetInfo(ClientAttributeOption attr, byte[] value) { checkIsInMultiOrPipeline(); connection.sendCommand(CLIENT, SETINFO.getRaw(), attr.getRaw(), value); return connection.getStatusCodeReply(); @@ -8522,7 +8522,7 @@ public String clientInfo() { } @Override - public String clientSetInfo(ClientAttrOption attr, String value) { + public String clientSetInfo(ClientAttributeOption attr, String value) { checkIsInMultiOrPipeline(); connection.sendCommand(CLIENT, SETINFO.getRaw(), attr.getRaw(), encode(value)); return connection.getStatusCodeReply(); diff --git a/src/main/java/redis/clients/jedis/args/ClientAttrOption.java b/src/main/java/redis/clients/jedis/args/ClientAttributeOption.java similarity index 77% rename from src/main/java/redis/clients/jedis/args/ClientAttrOption.java rename to src/main/java/redis/clients/jedis/args/ClientAttributeOption.java index 40120bc518..75bf92a76b 100644 --- a/src/main/java/redis/clients/jedis/args/ClientAttrOption.java +++ b/src/main/java/redis/clients/jedis/args/ClientAttributeOption.java @@ -6,13 +6,13 @@ * CLIENT SETINFO command attr option * since redis 7.2 */ -public enum ClientAttrOption implements Rawable { +public enum ClientAttributeOption implements Rawable { LIB_NAME("LIB-NAME"), LIB_VER("LIB-VER"); private final byte[] raw; - private ClientAttrOption(String str) { + private ClientAttributeOption(String str) { this.raw = SafeEncoder.encode(str); } diff --git a/src/main/java/redis/clients/jedis/commands/ClientBinaryCommands.java b/src/main/java/redis/clients/jedis/commands/ClientBinaryCommands.java index f49d35be4f..32efb7fe25 100644 --- a/src/main/java/redis/clients/jedis/commands/ClientBinaryCommands.java +++ b/src/main/java/redis/clients/jedis/commands/ClientBinaryCommands.java @@ -1,6 +1,6 @@ package redis.clients.jedis.commands; -import redis.clients.jedis.args.ClientAttrOption; +import redis.clients.jedis.args.ClientAttributeOption; import redis.clients.jedis.args.ClientPauseMode; import redis.clients.jedis.args.ClientType; import redis.clients.jedis.args.UnblockType; @@ -84,7 +84,7 @@ public interface ClientBinaryCommands { * @param value the value * @return OK or error */ - String clientSetInfo(ClientAttrOption attr, byte[] value); + String clientSetInfo(ClientAttributeOption attr, byte[] value); /** * Assigns a name to the current connection. diff --git a/src/main/java/redis/clients/jedis/commands/ClientCommands.java b/src/main/java/redis/clients/jedis/commands/ClientCommands.java index 2bfe121fd5..b4c93ed6dd 100644 --- a/src/main/java/redis/clients/jedis/commands/ClientCommands.java +++ b/src/main/java/redis/clients/jedis/commands/ClientCommands.java @@ -1,6 +1,6 @@ package redis.clients.jedis.commands; -import redis.clients.jedis.args.ClientAttrOption; +import redis.clients.jedis.args.ClientAttributeOption; import redis.clients.jedis.args.ClientPauseMode; import redis.clients.jedis.args.ClientType; import redis.clients.jedis.args.UnblockType; @@ -84,7 +84,7 @@ public interface ClientCommands { * @param value the value * @return OK or error */ - String clientSetInfo(ClientAttrOption attr, String value); + String clientSetInfo(ClientAttributeOption attr, String value); /** * Assigns a name to the current connection. diff --git a/src/test/java/redis/clients/jedis/commands/jedis/ClientCommandsTest.java b/src/test/java/redis/clients/jedis/commands/jedis/ClientCommandsTest.java index e7d8514658..6741a5d0d8 100644 --- a/src/test/java/redis/clients/jedis/commands/jedis/ClientCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/jedis/ClientCommandsTest.java @@ -21,7 +21,7 @@ import org.junit.Test; import redis.clients.jedis.Jedis; -import redis.clients.jedis.args.ClientAttrOption; +import redis.clients.jedis.args.ClientAttributeOption; import redis.clients.jedis.args.ClientType; import redis.clients.jedis.args.UnblockType; import redis.clients.jedis.exceptions.JedisConnectionException; @@ -68,8 +68,8 @@ public void nameBinary() { public void clientSetInfoDefault() { String libName = "jedis"; String libVersion = "999.999.999"; - Assert.assertEquals("OK", client.clientSetInfo(ClientAttrOption.LIB_NAME, libName)); - Assert.assertEquals("OK", client.clientSetInfo(ClientAttrOption.LIB_VER, libVersion)); + Assert.assertEquals("OK", client.clientSetInfo(ClientAttributeOption.LIB_NAME, libName)); + Assert.assertEquals("OK", client.clientSetInfo(ClientAttributeOption.LIB_VER, libVersion)); String info = client.clientInfo(); assertTrue(info.contains("lib-name=jedis")); assertTrue(info.contains("lib-ver=999.999.999"));