Skip to content

Commit

Permalink
Deprecate more items that will be removed in Jedis 5
Browse files Browse the repository at this point in the history
  • Loading branch information
sazzad16 committed Aug 22, 2023
1 parent 4916bd3 commit 358bd02
Show file tree
Hide file tree
Showing 20 changed files with 48 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/main/java/redis/clients/jedis/BuilderFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ public String toString() {
}
};

/**
* @deprecated Use {@link BuilderFactory#BINARY}.
*/
@Deprecated
public static final Builder<byte[]> BYTE_ARRAY = new Builder<byte[]>() {
@Override
public byte[] build(Object data) {
Expand All @@ -217,6 +221,10 @@ public String toString() {
}
};

/**
* @deprecated {@link BuilderFactory#BINARY_LIST}.
*/
@Deprecated
public static final Builder<List<byte[]>> BYTE_ARRAY_LIST = new Builder<List<byte[]>>() {
@Override
@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -335,6 +343,7 @@ public String toString() {
}
};

@Deprecated
public static final Builder<Set<String>> STRING_ORDERED_SET = new Builder<Set<String>>() {
@Override
@SuppressWarnings("unchecked")
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/redis/clients/jedis/CommandObjects.java
Original file line number Diff line number Diff line change
Expand Up @@ -3711,14 +3711,17 @@ public final CommandObject<List<Long>> jsonDebugMemory(String key, Path2 path) {
return new CommandObject<>(commandArguments(JsonCommand.DEBUG).add("MEMORY").key(key).add(path), BuilderFactory.LONG_LIST);
}

@Deprecated
public final CommandObject<List<Object>> jsonResp(String key) {
return new CommandObject<>(commandArguments(JsonCommand.RESP).key(key), BuilderFactory.ENCODED_OBJECT_LIST);
}

@Deprecated
public final CommandObject<List<Object>> jsonResp(String key, Path path) {
return new CommandObject<>(commandArguments(JsonCommand.RESP).key(key).add(path), BuilderFactory.ENCODED_OBJECT_LIST);
}

@Deprecated
public final CommandObject<List<List<Object>>> jsonResp(String key, Path2 path) {
return new CommandObject<>(commandArguments(JsonCommand.RESP).key(key).add(path), BuilderFactory.ENCODED_OBJECT_LIST_LIST);
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/redis/clients/jedis/Queable.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.LinkedList;
import java.util.Queue;

@Deprecated
public class Queable {

private final Queue<Response<?>> pipelinedResponses = new LinkedList<>();
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/redis/clients/jedis/UnifiedJedis.java
Original file line number Diff line number Diff line change
Expand Up @@ -4162,16 +4162,19 @@ public List<Long> jsonDebugMemory(String key, Path2 path) {
}

@Override
@Deprecated
public List<Object> jsonResp(String key) {
return executeCommand(commandObjects.jsonResp(key));
}

@Override
@Deprecated
public List<Object> jsonResp(String key, Path path) {
return executeCommand(commandObjects.jsonResp(key, path));
}

@Override
@Deprecated
public List<List<Object>> jsonResp(String key, Path2 path) {
return executeCommand(commandObjects.jsonResp(key, path));
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/redis/clients/jedis/json/RedisJsonCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,12 @@ default <T> List<T> jsonMGet(Class<T> clazz, String... keys) {

List<Long> jsonDebugMemory(String key, Path2 path);

@Deprecated
List<Object> jsonResp(String key);

@Deprecated
List<Object> jsonResp(String key, Path path);

@Deprecated
List<List<Object>> jsonResp(String key, Path2 path);
}
1 change: 1 addition & 0 deletions src/main/java/redis/clients/jedis/params/Params.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import redis.clients.jedis.args.Rawable;
import redis.clients.jedis.util.SafeEncoder;

@Deprecated
public abstract class Params {

private Map<String, Object> params;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public SortingParams nosort() {
return this;
}

@Deprecated
public Collection<byte[]> getParams() {
return Collections.unmodifiableCollection(params);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

/**
* This class is used to represent a List element when it is returned with respective key name.
* @deprecated Use {@link KeyValue}.
* @deprecated This class will be removed in next major released. Use {@link KeyValue}.
*/
@Deprecated
public class KeyedListElement extends KeyValue<String, String> {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/redis/clients/jedis/resps/KeyedZSetElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

/**
* This class is used to represent a SortedSet element when it is returned with respective key name.
* @deprecated This class will be removed in next major released.
*/
@Deprecated
public class KeyedZSetElement extends Tuple {

private final String key;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/redis/clients/jedis/search/Document.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public Document(String id, Map<String, Object> fields, double score) {
this(id, fields, score, null);
}

@Deprecated
public Document(String id, Map<String, Object> fields, double score, byte[] payload) {
this.id = id;
this.properties = new HashMap<>(fields);
Expand All @@ -46,10 +47,12 @@ public Iterable<Map.Entry<String, Object>> getProperties() {
return properties.entrySet();
}

@Deprecated
public static Document load(String id, double score, byte[] payload, List<byte[]> fields) {
return Document.load(id, score, payload, fields, true);
}

@Deprecated
public static Document load(String id, double score, byte[] payload, List<byte[]> fields, boolean decode) {
Document ret = new Document(id, score);
ret.payload = payload;
Expand Down Expand Up @@ -103,6 +106,7 @@ public double getScore() {
return score;
}

@Deprecated
public byte[] getPayload() {
return payload;
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/redis/clients/jedis/search/FieldName.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public FieldName as(String attribute) {
return this;
}

@Deprecated
public int addCommandEncodedArguments(List<String> args) {
args.add(name);
if (attribute == null) {
Expand All @@ -46,6 +47,7 @@ public int addCommandEncodedArguments(List<String> args) {
return 3;
}

@Deprecated
public int addCommandBinaryArguments(List<byte[]> args) {
args.add(SafeEncoder.encode(name));
if (attribute == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public IndexDefinition setScore(double score) {
return this;
}

@Deprecated
public String getPayloadField() {
return payloadField;
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/redis/clients/jedis/search/Query.java
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ public Query setWithScores() {
return this;
}

@Deprecated
public boolean getWithPayloads() {
return _withPayloads;
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/redis/clients/jedis/search/SearchResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static class SearchResultBuilder extends Builder<SearchResult> {
private final boolean hasPayloads;
private final boolean decode;

@Deprecated
public SearchResultBuilder(boolean hasContent, boolean hasScores, boolean hasPayloads, boolean decode) {
this.hasContent = hasContent;
this.hasScores = hasScores;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ public AggregationBuilder dialect(int dialect) {
return this;
}

@Deprecated
public List<String> getArgs() {
return Collections.unmodifiableList(args);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ public class AggregationResult {

private long cursorId = -1;

@Deprecated
public AggregationResult(Object resp, long cursorId) {
this(resp);
this.cursorId = cursorId;
}

@Deprecated
public AggregationResult(Object resp) {
List<Object> list = (List<Object>) SafeEncoder.encodeObject(resp);

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/redis/clients/jedis/search/aggr/Group.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public Group reduce(Reducer r) {
return this;
}

@Deprecated
public Group limit(Limit limit) {
this.limit = limit;
return this;
Expand All @@ -43,6 +44,7 @@ public void addArgs(List<String> args) {
args.addAll(limit.getArgs());
}

@Deprecated
public List<String> getArgs() {
List<String> args = new ArrayList<>();
addArgs(args);
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/redis/clients/jedis/search/aggr/Limit.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

/**
* Created by mnunberg on 2/22/18.
* @deprecated This class will be removed in next major released.
*/
@Deprecated
public class Limit {

public static final Limit NO_LIMIT = new Limit(0, 0);
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/redis/clients/jedis/timeseries/TSKeyValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
import java.util.Map;
import redis.clients.jedis.util.KeyValue;

/**
* @deprecated This class will be removed in next major released.
*/
@Deprecated
public class TSKeyValue<V> extends KeyValue<String, V> {

private final Map<String, String> labels;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
import java.util.List;
import java.util.Map;

/**
* @deprecated This class will be removed in next major released.
*/
@Deprecated
public class TSKeyedElements extends TSKeyValue<List<TSElement>> {

public TSKeyedElements(String key, Map<String, String> labels, List<TSElement> elements) {
Expand Down

0 comments on commit 358bd02

Please sign in to comment.