Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Rawable interface #2370

Merged
merged 6 commits into from
Mar 17, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main/java/redis/clients/jedis/Protocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.List;
import java.util.Locale;

import redis.clients.jedis.args.Raw;
import redis.clients.jedis.commands.ProtocolCommand;
import redis.clients.jedis.exceptions.*;
import redis.clients.jedis.util.RedisInputStream;
Expand Down Expand Up @@ -275,7 +276,7 @@ public byte[] getRaw() {
}
}

public static enum Keyword {
public static enum Keyword implements Raw {
AGGREGATE, ALPHA, ASC, BY, DESC, GET, LIMIT, MESSAGE, NO, NOSORT, PMESSAGE, PSUBSCRIBE,
PUNSUBSCRIBE, OK, ONE, QUEUED, SET, STORE, SUBSCRIBE, UNSUBSCRIBE, WEIGHTS, WITHSCORES,
RESETSTAT, REWRITE, RESET, FLUSH, EXISTS, LOAD, KILL, LEN, REFCOUNT, ENCODING, IDLETIME,
Expand All @@ -294,6 +295,7 @@ public static enum Keyword {
raw = SafeEncoder.encode(this.name().toLowerCase(Locale.ENGLISH));
}

@Override
public byte[] getRaw() {
return raw;
}
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/redis/clients/jedis/args/Raw.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package redis.clients.jedis.args;

public interface Raw {

byte[] getRaw();
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package redis.clients.jedis.commands;

public interface ProtocolCommand {

byte[] getRaw();
import redis.clients.jedis.args.Raw;

public interface ProtocolCommand extends Raw {
}