98
98
* @author Ninad Divadkar
99
99
* @author Guy Korland
100
100
* @author dengliming
101
+ * @author John Blum
101
102
*/
102
103
@ SuppressWarnings ("ConstantConditions" )
103
104
abstract class JedisConverters extends Converters {
@@ -122,7 +123,6 @@ public static Converter<String, byte[]> stringToBytes() {
122
123
/**
123
124
* {@link ListConverter} converting jedis {@link redis.clients.jedis.resps.Tuple} to {@link Tuple}.
124
125
*
125
- * @return
126
126
* @since 1.4
127
127
*/
128
128
static ListConverter <redis .clients .jedis .resps .Tuple , Tuple > tuplesToTuples () {
@@ -145,7 +145,6 @@ public static Tuple toTuple(redis.clients.jedis.resps.Tuple source) {
145
145
* Map a {@link Set} of {@link Tuple} by {@code value} to its {@code score}.
146
146
*
147
147
* @param tuples must not be {@literal null}.
148
- * @return
149
148
* @since 2.0
150
149
*/
151
150
public static Map <byte [], Double > toTupleMap (Set <Tuple > tuples ) {
@@ -170,8 +169,6 @@ public static byte[] toBytes(Long source) {
170
169
}
171
170
172
171
/**
173
- * @param source
174
- * @return
175
172
* @since 1.6
176
173
*/
177
174
public static byte [] toBytes (Double source ) {
@@ -204,24 +201,23 @@ public static ValueEncoding toEncoding(byte[] source) {
204
201
}
205
202
206
203
/**
207
- * @param source
208
- * @return
209
204
* @since 1.7
210
205
*/
211
206
@ SuppressWarnings ("unchecked" )
212
207
public static RedisClusterNode toNode (Object source ) {
213
208
214
209
List <Object > values = (List <Object >) source ;
210
+
215
211
RedisClusterNode .SlotRange range = new RedisClusterNode .SlotRange (((Number ) values .get (0 )).intValue (),
216
212
((Number ) values .get (1 )).intValue ());
213
+
217
214
List <Object > nodeInfo = (List <Object >) values .get (2 );
215
+
218
216
return new RedisClusterNode (toString ((byte []) nodeInfo .get (0 )), ((Number ) nodeInfo .get (1 )).intValue (), range );
219
217
220
218
}
221
219
222
220
/**
223
- * @param source
224
- * @return
225
221
* @since 1.3
226
222
*/
227
223
public static List <RedisClientInfo > toListOfRedisClientInformation (String source ) {
@@ -234,8 +230,6 @@ public static List<RedisClientInfo> toListOfRedisClientInformation(String source
234
230
}
235
231
236
232
/**
237
- * @param source
238
- * @return
239
233
* @since 1.4
240
234
*/
241
235
public static List <RedisServer > toListOfRedisServer (List <Map <String , String >> source ) {
@@ -288,6 +282,7 @@ public static SortingParams toSortingParams(@Nullable SortParameters params) {
288
282
}
289
283
290
284
public static BitOP toBitOp (BitOperation bitOp ) {
285
+
291
286
return switch (bitOp ) {
292
287
case AND -> BitOP .AND ;
293
288
case OR -> BitOP .OR ;
@@ -297,12 +292,9 @@ public static BitOP toBitOp(BitOperation bitOp) {
297
292
}
298
293
299
294
/**
300
- * Converts a given {@link Bound} to its binary representation suitable for {@literal ZRANGEBY*} commands, despite
301
- * {@literal ZRANGEBYLEX}.
295
+ * Converts a given {@link org.springframework.data.domain.Range. Bound} to its binary representation suitable for
296
+ * {@literal ZRANGEBY*} commands, despite {@literal ZRANGEBYLEX}.
302
297
*
303
- * @param boundary
304
- * @param defaultValue
305
- * @return
306
298
* @since 1.6
307
299
*/
308
300
public static byte [] boundaryToBytesForZRange (@ Nullable org .springframework .data .domain .Range .Bound <?> boundary ,
@@ -316,10 +308,9 @@ public static byte[] boundaryToBytesForZRange(@Nullable org.springframework.data
316
308
}
317
309
318
310
/**
319
- * Converts a given {@link Bound} to its binary representation suitable for ZRANGEBYLEX command.
311
+ * Converts a given {@link org.springframework.data.domain.Range.Bound} to its binary representation suitable for
312
+ * {@literal ZRANGEBYLEX} command.
320
313
*
321
- * @param boundary
322
- * @return
323
314
* @since 1.6
324
315
*/
325
316
public static byte [] boundaryToBytesForZRangeByLex (
@@ -342,7 +333,6 @@ public static byte[] boundaryToBytesForZRangeByLex(
342
333
* </dl>
343
334
*
344
335
* @param expiration must not be {@literal null}.
345
- * @return
346
336
* @since 2.2
347
337
*/
348
338
public static SetParams toSetCommandExPxArgument (Expiration expiration ) {
@@ -359,8 +349,6 @@ public static SetParams toSetCommandExPxArgument(Expiration expiration) {
359
349
* </dl>
360
350
*
361
351
* @param expiration must not be {@literal null}.
362
- * @param params
363
- * @return
364
352
* @since 2.2
365
353
*/
366
354
public static SetParams toSetCommandExPxArgument (Expiration expiration , SetParams params ) {
@@ -395,7 +383,6 @@ public static SetParams toSetCommandExPxArgument(Expiration expiration, SetParam
395
383
* </dl>
396
384
*
397
385
* @param expiration must not be {@literal null}.
398
- * @return
399
386
* @since 2.6
400
387
*/
401
388
static GetExParams toGetExParams (Expiration expiration ) {
@@ -429,7 +416,6 @@ static GetExParams toGetExParams(Expiration expiration) {
429
416
* </dl>
430
417
*
431
418
* @param option must not be {@literal null}.
432
- * @return
433
419
* @since 2.2
434
420
*/
435
421
public static SetParams toSetCommandNxXxArgument (SetOption option ) {
@@ -448,8 +434,6 @@ public static SetParams toSetCommandNxXxArgument(SetOption option) {
448
434
* </dl>
449
435
*
450
436
* @param option must not be {@literal null}.
451
- * @param params
452
- * @return
453
437
* @since 2.2
454
438
*/
455
439
public static SetParams toSetCommandNxXxArgument (SetOption option , SetParams params ) {
@@ -492,9 +476,6 @@ private static byte[] boundaryToBytes(org.springframework.data.domain.Range.Boun
492
476
493
477
/**
494
478
* Convert {@link ScanOptions} to Jedis {@link ScanParams}.
495
- *
496
- * @param options
497
- * @return
498
479
*/
499
480
public static ScanParams toScanParams (ScanOptions options ) {
500
481
@@ -523,8 +504,6 @@ static Long toTime(List<String> source, TimeUnit timeUnit) {
523
504
}
524
505
525
506
/**
526
- * @param source
527
- * @return
528
507
* @since 1.8
529
508
*/
530
509
public static List <String > toStrings (List <byte []> source ) {
@@ -547,15 +526,13 @@ private static <S, T> List<T> toList(Converter<S, T> converter, @Nullable Collec
547
526
}
548
527
549
528
/**
550
- * @return
551
529
* @since 1.8
552
530
*/
553
531
public static ListConverter <redis .clients .jedis .GeoCoordinate , Point > geoCoordinateToPointConverter () {
554
532
return new ListConverter <>(JedisConverters ::toPoint );
555
533
}
556
534
557
535
/**
558
- * @return
559
536
* @since 2.5
560
537
*/
561
538
@ Nullable
@@ -566,8 +543,6 @@ static Point toPoint(@Nullable redis.clients.jedis.GeoCoordinate geoCoordinate)
566
543
/**
567
544
* Convert {@link Point} into {@link GeoCoordinate}.
568
545
*
569
- * @param source
570
- * @return
571
546
* @since 1.8
572
547
*/
573
548
public static GeoCoordinate toGeoCoordinate (Point source ) {
@@ -577,8 +552,6 @@ public static GeoCoordinate toGeoCoordinate(Point source) {
577
552
/**
578
553
* Get a {@link Converter} capable of converting {@link GeoRadiusResponse} into {@link GeoResults}.
579
554
*
580
- * @param metric
581
- * @return
582
555
* @since 1.8
583
556
*/
584
557
public static Converter <List <GeoRadiusResponse >, GeoResults <GeoLocation <byte []>>> geoRadiusResponseToGeoResultsConverter (
@@ -589,8 +562,6 @@ public static Converter<List<GeoRadiusResponse>, GeoResults<GeoLocation<byte[]>>
589
562
/**
590
563
* Convert {@link Metric} into {@link GeoUnit}.
591
564
*
592
- * @param metric
593
- * @return
594
565
* @since 1.8
595
566
*/
596
567
public static GeoUnit toGeoUnit (Metric metric ) {
@@ -640,8 +611,6 @@ static ZAddParams toZAddParams(ZAddArgs source) {
640
611
/**
641
612
* Convert {@link GeoRadiusCommandArgs} into {@link GeoRadiusParam}.
642
613
*
643
- * @param source
644
- * @return
645
614
* @since 1.8
646
615
*/
647
616
public static GeoRadiusParam toGeoRadiusParam (GeoRadiusCommandArgs source ) {
@@ -677,9 +646,6 @@ public static GeoRadiusParam toGeoRadiusParam(GeoRadiusCommandArgs source) {
677
646
/**
678
647
* Convert a timeout to seconds using {@code double} representation including fraction of seconds.
679
648
*
680
- * @param timeout
681
- * @param unit
682
- * @return
683
649
* @since 2.6
684
650
*/
685
651
static double toSeconds (long timeout , TimeUnit unit ) {
@@ -697,7 +663,6 @@ static double toSeconds(long timeout, TimeUnit unit) {
697
663
/**
698
664
* Convert given {@link BitFieldSubCommands} into argument array.
699
665
*
700
- * @param source
701
666
* @return never {@literal null}.
702
667
* @since 1.8
703
668
*/
0 commit comments