Skip to content

Commit 8e40c3c

Browse files
authored
[code cleanup] Jedis client to implement CommandCommands interface (#4077)
[code cleanup] Jedis client to implment CommandCommands interface When support for COMMAND was added we have missed to add the interface to Jedis client itself
1 parent 74f3952 commit 8e40c3c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/main/java/redis/clients/jedis/Jedis.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
public class Jedis implements ServerCommands, DatabaseCommands, JedisCommands, JedisBinaryCommands,
3636
ControlCommands, ControlBinaryCommands, ClusterCommands, ModuleCommands, GenericControlCommands,
37-
SentinelCommands, Closeable {
37+
SentinelCommands, CommandCommands, Closeable {
3838

3939
protected final Connection connection;
4040
private final CommandObjects commandObjects = new CommandObjects();
@@ -8223,48 +8223,56 @@ public long bitop(final BitOP op, final String destKey, final String... srcKeys)
82238223
return connection.executeCommand(commandObjects.bitop(op, destKey, srcKeys));
82248224
}
82258225

8226+
@Override
82268227
public long commandCount() {
82278228
checkIsInMultiOrPipeline();
82288229
connection.sendCommand(COMMAND, COUNT);
82298230
return connection.getIntegerReply();
82308231
}
82318232

8233+
@Override
82328234
public Map<String, CommandDocument> commandDocs(String... commands) {
82338235
checkIsInMultiOrPipeline();
82348236
connection.sendCommand(COMMAND, joinParameters(DOCS.name(), commands));
82358237
return BuilderFactory.COMMAND_DOCS_RESPONSE.build(connection.getOne());
82368238
}
82378239

8240+
@Override
82388241
public List<String> commandGetKeys(String... command) {
82398242
checkIsInMultiOrPipeline();
82408243
connection.sendCommand(COMMAND, joinParameters(GETKEYS.name(), command));
82418244
return BuilderFactory.STRING_LIST.build(connection.getOne());
82428245
}
82438246

8247+
@Override
82448248
public List<KeyValue<String, List<String>>> commandGetKeysAndFlags(String... command) {
82458249
checkIsInMultiOrPipeline();
82468250
connection.sendCommand(COMMAND, joinParameters(GETKEYSANDFLAGS.name(), command));
82478251
return BuilderFactory.KEYED_STRING_LIST_LIST.build(connection.getOne());
82488252
}
82498253

8254+
@Override
82508255
public Map<String, CommandInfo> commandInfo(String... commands) {
82518256
checkIsInMultiOrPipeline();
82528257
connection.sendCommand(COMMAND, joinParameters(Keyword.INFO.name(), commands));
82538258
return CommandInfo.COMMAND_INFO_RESPONSE.build(connection.getOne());
82548259
}
82558260

8261+
@Override
82568262
public Map<String, CommandInfo> command() {
82578263
checkIsInMultiOrPipeline();
82588264
connection.sendCommand(COMMAND);
82598265
return CommandInfo.COMMAND_INFO_RESPONSE.build(connection.getOne());
82608266
}
82618267

8268+
@Override
82628269
public List<String> commandList() {
82638270
checkIsInMultiOrPipeline();
82648271
connection.sendCommand(COMMAND, LIST);
82658272
return BuilderFactory.STRING_LIST.build(connection.getOne());
82668273
}
82678274

8275+
@Override
82688276
public List<String> commandListFilterBy(CommandListFilterByParams filterByParams) {
82698277
checkIsInMultiOrPipeline();
82708278
CommandArguments args = new CommandArguments(COMMAND).add(LIST).addParams(filterByParams);

src/main/java/redis/clients/jedis/commands/CommandCommands.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ public interface CommandCommands {
4646
*/
4747
Map<String, CommandInfo> commandInfo(String... commands);
4848

49+
/**
50+
* Return an array with details about every Redis command.
51+
* @return list of {@link CommandInfo}
52+
*/
53+
Map<String, CommandInfo> command();
54+
4955
/**
5056
* Return a list of the server's command names
5157
* @return commands list

0 commit comments

Comments
 (0)