Skip to content

Commit b61a3d2

Browse files
Update deprecation warnings and method visibility.
1 parent 7527913 commit b61a3d2

File tree

5 files changed

+33
-21
lines changed

5 files changed

+33
-21
lines changed

src/main/java/org/springframework/data/redis/connection/jedis/JedisConverters.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,14 @@ public static byte[] toBytes(Number source) {
176176
return toBytes(String.valueOf(source));
177177
}
178178

179-
public static byte[] toBytes(Cursor.CursorId source) {
179+
/**
180+
* Convert the given {@link org.springframework.data.redis.core.Cursor.CursorId} into its binary representation.
181+
*
182+
* @param source must not be {@literal null}.
183+
* @return the binary representation.
184+
* @since 3.3
185+
*/
186+
static byte[] toBytes(Cursor.CursorId source) {
180187
return toBytes(source.getCursorId());
181188
}
182189

src/main/java/org/springframework/data/redis/core/Cursor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ public interface Cursor<T> extends CloseableIterator<T> {
4949
* <strong>NOTE:</strong> the id might change while iterating items.
5050
*
5151
* @return
52-
* @deprecated since 3.2.1, use {@link #getId()} instead as the cursorId can exceed {@link Long#MAX_VALUE}.
52+
* @deprecated since 3.3.0, use {@link #getId()} instead as the cursorId can exceed {@link Long#MAX_VALUE}.
5353
*/
54-
@Deprecated(since = "3.2.1")
54+
@Deprecated(since = "3.3.0")
5555
long getCursorId();
5656

5757
/**

src/main/java/org/springframework/data/redis/core/KeyBoundCursor.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ public abstract class KeyBoundCursor<T> extends ScanCursor<T> {
3131
*
3232
* @param cursorId
3333
* @param options Defaulted to {@link ScanOptions#NONE} if nulled.
34+
* @deprecated since 3.3.0 - Use {@link KeyBoundCursor#KeyBoundCursor(byte[], CursorId, ScanOptions)} instead.
3435
*/
36+
@Deprecated(since = "3.3.0")
3537
public KeyBoundCursor(byte[] key, long cursorId, @Nullable ScanOptions options) {
3638
super(cursorId, options != null ? options : ScanOptions.NONE);
3739
this.key = key;
@@ -42,6 +44,7 @@ public KeyBoundCursor(byte[] key, long cursorId, @Nullable ScanOptions options)
4244
*
4345
* @param cursorId
4446
* @param options Defaulted to {@link ScanOptions#NONE} if nulled.
47+
* @since 3.3.0
4548
*/
4649
public KeyBoundCursor(byte[] key, CursorId cursorId, @Nullable ScanOptions options) {
4750
super(cursorId, options != null ? options : ScanOptions.NONE);

src/main/java/org/springframework/data/redis/core/ScanCursor.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ public ScanCursor(ScanOptions options) {
6565
* Crates new {@link ScanCursor} with {@link ScanOptions#NONE}
6666
*
6767
* @param cursorId the cursor Id.
68-
* @deprecated since 3.2.1
68+
* @deprecated since 3.3.0 - Use {@link ScanCursor#ScanCursor(CursorId)} instead.
6969
*/
70-
@Deprecated
70+
@Deprecated(since = "3.3.0")
7171
public ScanCursor(long cursorId) {
7272
this(cursorId, ScanOptions.NONE);
7373
}
@@ -76,7 +76,7 @@ public ScanCursor(long cursorId) {
7676
* Crates new {@link ScanCursor} with {@link ScanOptions#NONE}
7777
*
7878
* @param cursorId the cursor Id.
79-
* @since 3.2.1
79+
* @since 3.3.0
8080
*/
8181
public ScanCursor(CursorId cursorId) {
8282
this(cursorId, ScanOptions.NONE);
@@ -87,9 +87,9 @@ public ScanCursor(CursorId cursorId) {
8787
*
8888
* @param cursorId the cursor Id.
8989
* @param options Defaulted to {@link ScanOptions#NONE} if {@code null}.
90-
* @deprecated since 3.2.1
90+
* @deprecated since 3.3.0 - Use {@link ScanCursor#ScanCursor(CursorId, ScanOptions)} instead.
9191
*/
92-
@Deprecated
92+
@Deprecated(since = "3.3.0")
9393
public ScanCursor(long cursorId, @Nullable ScanOptions options) {
9494
this(CursorId.of(cursorId), options);
9595
}
@@ -99,7 +99,7 @@ public ScanCursor(long cursorId, @Nullable ScanOptions options) {
9999
*
100100
* @param cursorId the cursor Id.
101101
* @param options Defaulted to {@link ScanOptions#NONE} if {@code null}.
102-
* @since 3.2.1
102+
* @since 3.3.0
103103
*/
104104
public ScanCursor(CursorId cursorId, @Nullable ScanOptions options) {
105105

@@ -130,9 +130,9 @@ private void scan(CursorId cursorId) {
130130
* @param cursorId
131131
* @param options
132132
* @return
133-
* @deprecated since 3.2.1, cursorId, can exceed {@link Long#MAX_VALUE}.
133+
* @deprecated since 3.3.0, cursorId, can exceed {@link Long#MAX_VALUE}.
134134
*/
135-
@Deprecated(since = "3.2.1")
135+
@Deprecated(since = "3.3.0")
136136
protected ScanIteration<T> doScan(long cursorId, ScanOptions options) {
137137
return doScan(CursorId.of(cursorId), scanOptions);
138138
}
@@ -144,7 +144,7 @@ protected ScanIteration<T> doScan(long cursorId, ScanOptions options) {
144144
* @param cursorId
145145
* @param options
146146
* @return
147-
* @since 3.2.1
147+
* @since 3.3.0
148148
*/
149149
protected ScanIteration<T> doScan(CursorId cursorId, ScanOptions options) {
150150
return doScan(Long.parseLong(cursorId.getCursorId()), scanOptions);
@@ -169,9 +169,9 @@ public final ScanCursor<T> open() {
169169
* Customization hook when calling {@link #open()}.
170170
*
171171
* @param cursorId
172-
* @deprecated since 3.2.1, use {@link #doOpen(CursorId)} instead.
172+
* @deprecated since 3.3.0, use {@link #doOpen(CursorId)} instead.
173173
*/
174-
@Deprecated(since = "3.2.1", forRemoval = true)
174+
@Deprecated(since = "3.3.0", forRemoval = true)
175175
protected void doOpen(long cursorId) {
176176
doOpen(CursorId.of(cursorId));
177177
}
@@ -207,7 +207,7 @@ private void processScanResult(ScanIteration<T> result) {
207207
* @return {@literal true} if the cursor is considered finished, {@literal false} otherwise.s
208208
* @since 2.1
209209
*/
210-
@Deprecated(since = "3.2.1", forRemoval = true)
210+
@Deprecated(since = "3.3.0", forRemoval = true)
211211
protected boolean isFinished(long cursorId) {
212212
return cursorId == 0;
213213
}
@@ -217,7 +217,7 @@ protected boolean isFinished(long cursorId) {
217217
*
218218
* @param cursorId the cursor Id
219219
* @return {@literal true} if the cursor is considered finished, {@literal false} otherwise.s
220-
* @since 2.1
220+
* @since 3.3.0
221221
*/
222222
protected boolean isFinished(CursorId cursorId) {
223223
return CursorId.isInitial(cursorId.getCursorId());

src/main/java/org/springframework/data/redis/core/ScanIteration.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,18 @@ public class ScanIteration<T> implements Iterable<T> {
4040
/**
4141
* @param cursorId
4242
* @param items
43-
* @deprecated since 3.2.1, use {@link ScanIteration#ScanIteration(String, Collection)} instead as {@code cursorId}
43+
* @deprecated since 3.3.0, use {@link ScanIteration#ScanIteration(CursorId, Collection)} instead as {@code cursorId}
4444
* can exceed {@link Long#MAX_VALUE}.
4545
*/
46-
@Deprecated(since = "3.2.1")
46+
@Deprecated(since = "3.3.0")
4747
public ScanIteration(long cursorId, @Nullable Collection<T> items) {
4848
this(CursorId.of(cursorId), items);
4949
}
5050

5151
/**
52-
* @param rawCursorId
52+
* @param cursorId
5353
* @param items
54+
* @since 3.3.0
5455
*/
5556
public ScanIteration(CursorId cursorId, @Nullable Collection<T> items) {
5657

@@ -62,9 +63,9 @@ public ScanIteration(CursorId cursorId, @Nullable Collection<T> items) {
6263
* The cursor id to be used for subsequent requests.
6364
*
6465
* @return
65-
* @deprecated since 3.2.1, use {@link #getId()} instead as the cursorId can exceed {@link Long#MAX_VALUE}.
66+
* @deprecated since 3.3.0, use {@link #getId()} instead as the cursorId can exceed {@link Long#MAX_VALUE}.
6667
*/
67-
@Deprecated
68+
@Deprecated(since="3.3.3")
6869
public long getCursorId() {
6970
return Long.parseLong(getId().getCursorId());
7071
}
@@ -73,6 +74,7 @@ public long getCursorId() {
7374
* The cursor id to be used for subsequent requests.
7475
*
7576
* @return
77+
* @since 3.3.0
7678
*/
7779
public CursorId getId() {
7880
return cursorId;

0 commit comments

Comments
 (0)