Skip to content

Commit

Permalink
Address Javadoc warnings (and related changes) (#2730)
Browse files Browse the repository at this point in the history
  • Loading branch information
sazzad16 authored Dec 12, 2021
1 parent d210d79 commit c0136df
Show file tree
Hide file tree
Showing 8 changed files with 225 additions and 259 deletions.
5 changes: 0 additions & 5 deletions src/main/java/redis/clients/jedis/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,6 @@ public List<byte[]> getBinaryMultiBulkReply() {
return (List<byte[]>) readProtocolWithCheckingBroken();
}

@Deprecated
public List<Object> getRawObjectMultiBulkReply() {
return getUnflushedObjectMultiBulkReply();
}

@SuppressWarnings("unchecked")
public List<Object> getUnflushedObjectMultiBulkReply() {
return (List<Object>) readProtocolWithCheckingBroken();
Expand Down
427 changes: 213 additions & 214 deletions src/main/java/redis/clients/jedis/Jedis.java

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/main/java/redis/clients/jedis/Pipeline.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public List<Object> syncAndReturnAll() {
}
}

@Deprecated
public final boolean hasPipelinedResponse() {
return getPipelinedResponseLength() > 0;
}
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/redis/clients/jedis/Sentinel.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ public String sentinelMyId() {
* 24) "2"
*
* </pre>
* @return
*/
@Override
public List<Map<String, String>> sentinelMasters() {
Expand Down Expand Up @@ -299,7 +298,6 @@ public List<String> sentinelGetMasterAddrByName(String masterName) {
* (integer) 1
* </pre>
* @param pattern
* @return
*/
@Override
public Long sentinelReset(String pattern) {
Expand Down Expand Up @@ -340,7 +338,6 @@ public Long sentinelReset(String pattern) {
* 28) "100"
* </pre>
* @param masterName
* @return
*/
@Override
public List<Map<String, String>> sentinelSlaves(String masterName) {
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/redis/clients/jedis/params/ScanParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ public ScanParams match(final byte[] pattern) {

/**
* @see <a href="https://redis.io/commands/scan#the-match-option">MATCH option in Redis documentation</a>
*
* @param pattern
* @return
*/
public ScanParams match(final String pattern) {
params.put(MATCH, ByteBuffer.wrap(SafeEncoder.encode(pattern)));
Expand All @@ -38,9 +35,6 @@ public ScanParams match(final String pattern) {

/**
* @see <a href="https://redis.io/commands/scan#the-count-option">COUNT option in Redis documentation</a>
*
* @param count
* @return
*/
public ScanParams count(final Integer count) {
params.put(COUNT, ByteBuffer.wrap(Protocol.toByteArray(count)));
Expand Down
11 changes: 0 additions & 11 deletions src/main/java/redis/clients/jedis/params/SetParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ public static SetParams setParams() {
return new SetParams();
}

/**
* Set the specified expire time, in seconds.
* @param secondsToExpire
* @return SetParams
* @deprecated Use {@link #ex(long)}.
*/
@Deprecated
public SetParams ex(int secondsToExpire) {
return ex((long) secondsToExpire);
}

/**
* Set the specified expire time, in seconds.
* @param secondsToExpire
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import redis.clients.jedis.util.SafeEncoder;

/**
* Builder Class for {@link Jedis#sort(String, SortingParams) SORT} Parameters.
* Builder Class for {@code SORT} command parameters.
*/
public class SortingParams implements IParams {
private final List<byte[]> params = new ArrayList<>();
Expand Down
29 changes: 11 additions & 18 deletions src/main/java/redis/clients/jedis/params/ZParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,41 @@
import java.util.List;

import redis.clients.jedis.CommandArguments;
import redis.clients.jedis.Protocol;
import redis.clients.jedis.args.Rawable;
import redis.clients.jedis.util.SafeEncoder;

public class ZParams implements IParams {

public enum Aggregate {
public enum Aggregate implements Rawable {

SUM, MIN, MAX;

/**
* @deprecated This will be private in future. Use {@link #getRaw()}.
*/
@Deprecated
public final byte[] raw;
private final byte[] raw;

Aggregate() {
private Aggregate() {
raw = SafeEncoder.encode(name());
}

@Override
public byte[] getRaw() {
return raw;
}
}

private final List<byte[]> params = new ArrayList<>();
private final List<Object> params = new ArrayList<>();

/**
* Set weights.
* @param weights weights.
* @return
*/
public ZParams weights(final double... weights) {
params.add(WEIGHTS.getRaw());
params.add(WEIGHTS);
for (final double weight : weights) {
params.add(Protocol.toByteArray(weight));
params.add(weight);
}

return this;
}

public ZParams aggregate(final Aggregate aggregate) {
params.add(AGGREGATE.getRaw());
params.add(aggregate.raw);
params.add(AGGREGATE);
params.add(aggregate);
return this;
}

Expand Down

0 comments on commit c0136df

Please sign in to comment.