Skip to content

Commit b45d358

Browse files
mp911dechristophstrobl
authored andcommitted
Move Tuple, Limit, and Weights to top-level types.
See: #2273 Original Pull Request: #2276
1 parent 91cfbf5 commit b45d358

File tree

61 files changed

+525
-629
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+525
-629
lines changed

src/main/java/org/springframework/data/redis/Version.java

Lines changed: 0 additions & 103 deletions
This file was deleted.

src/main/java/org/springframework/data/redis/VersionParser.java

Lines changed: 0 additions & 58 deletions
This file was deleted.

src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848
import org.springframework.data.redis.connection.stream.StreamOffset;
4949
import org.springframework.data.redis.connection.stream.StreamReadOptions;
5050
import org.springframework.data.redis.connection.stream.StringRecord;
51+
import org.springframework.data.redis.connection.zset.DefaultTuple;
52+
import org.springframework.data.redis.connection.zset.Tuple;
53+
import org.springframework.data.redis.connection.zset.Weights;
5154
import org.springframework.data.redis.core.ConvertingCursor;
5255
import org.springframework.data.redis.core.Cursor;
5356
import org.springframework.data.redis.core.ScanOptions;
@@ -1042,7 +1045,7 @@ public Set<byte[]> zRangeByScore(byte[] key, Range range) {
10421045
}
10431046

10441047
@Override
1045-
public Set<byte[]> zRangeByScore(byte[] key, Range range, Limit limit) {
1048+
public Set<byte[]> zRangeByScore(byte[] key, Range range, org.springframework.data.redis.connection.Limit limit) {
10461049
return convertAndReturn(delegate.zRangeByScore(key, range, limit), Converters.identityConverter());
10471050
}
10481051

@@ -1063,7 +1066,8 @@ public Set<Tuple> zRangeByScoreWithScores(byte[] key, double min, double max, lo
10631066
}
10641067

10651068
@Override
1066-
public Set<Tuple> zRangeByScoreWithScores(byte[] key, Range range, Limit limit) {
1069+
public Set<Tuple> zRangeByScoreWithScores(byte[] key, Range range,
1070+
org.springframework.data.redis.connection.Limit limit) {
10671071
return convertAndReturn(delegate.zRangeByScoreWithScores(key, range, limit), Converters.identityConverter());
10681072
}
10691073

@@ -1093,7 +1097,7 @@ public Set<byte[]> zRevRangeByScore(byte[] key, double min, double max) {
10931097
}
10941098

10951099
@Override
1096-
public Set<byte[]> zRevRangeByScore(byte[] key, Range range, Limit limit) {
1100+
public Set<byte[]> zRevRangeByScore(byte[] key, Range range, org.springframework.data.redis.connection.Limit limit) {
10971101
return convertAndReturn(delegate.zRevRangeByScore(key, range, limit), Converters.identityConverter());
10981102
}
10991103

@@ -1109,7 +1113,8 @@ public Set<Tuple> zRevRangeByScoreWithScores(byte[] key, Range range) {
11091113
}
11101114

11111115
@Override
1112-
public Set<Tuple> zRevRangeByScoreWithScores(byte[] key, Range range, Limit limit) {
1116+
public Set<Tuple> zRevRangeByScoreWithScores(byte[] key, Range range,
1117+
org.springframework.data.redis.connection.Limit limit) {
11131118
return convertAndReturn(delegate.zRevRangeByScoreWithScores(key, range, limit), Converters.identityConverter());
11141119
}
11151120

@@ -2589,7 +2594,7 @@ public Set<byte[]> zRangeByLex(byte[] key, Range range) {
25892594
}
25902595

25912596
@Override
2592-
public Set<byte[]> zRangeByLex(byte[] key, Range range, Limit limit) {
2597+
public Set<byte[]> zRangeByLex(byte[] key, Range range, org.springframework.data.redis.connection.Limit limit) {
25932598
return convertAndReturn(delegate.zRangeByLex(key, range, limit), Converters.identityConverter());
25942599
}
25952600

@@ -2600,21 +2605,21 @@ public Set<String> zRangeByLex(String key) {
26002605

26012606
@Override
26022607
public Set<String> zRangeByLex(String key, Range range) {
2603-
return zRangeByLex(key, range, Limit.unlimited());
2608+
return zRangeByLex(key, range, org.springframework.data.redis.connection.Limit.unlimited());
26042609
}
26052610

26062611
@Override
2607-
public Set<String> zRangeByLex(String key, Range range, Limit limit) {
2612+
public Set<String> zRangeByLex(String key, Range range, org.springframework.data.redis.connection.Limit limit) {
26082613
return convertAndReturn(delegate.zRangeByLex(serialize(key), range, limit), byteSetToStringSet);
26092614
}
26102615

26112616
@Override
2612-
public Set<byte[]> zRevRangeByLex(byte[] key, Range range, Limit limit) {
2617+
public Set<byte[]> zRevRangeByLex(byte[] key, Range range, org.springframework.data.redis.connection.Limit limit) {
26132618
return convertAndReturn(delegate.zRevRangeByLex(key, range, limit), Converters.identityConverter());
26142619
}
26152620

26162621
@Override
2617-
public Set<String> zRevRangeByLex(String key, Range range, Limit limit) {
2622+
public Set<String> zRevRangeByLex(String key, Range range, org.springframework.data.redis.connection.Limit limit) {
26182623
return convertAndReturn(delegate.zRevRangeByLex(serialize(key), range, limit), byteSetToStringSet);
26192624
}
26202625

@@ -2720,7 +2725,8 @@ public PendingMessages xPending(String key, String groupName, XPendingOptions op
27202725
}
27212726

27222727
@Override
2723-
public List<StringRecord> xRange(String key, org.springframework.data.domain.Range<String> range, Limit limit) {
2728+
public List<StringRecord> xRange(String key, org.springframework.data.domain.Range<String> range,
2729+
org.springframework.data.redis.connection.Limit limit) {
27242730
return convertAndReturn(delegate.xRange(serialize(key), range, limit), listByteMapRecordToStringMapRecordConverter);
27252731
}
27262732

@@ -2739,7 +2745,8 @@ public List<StringRecord> xReadGroupAsString(Consumer consumer, StreamReadOption
27392745
}
27402746

27412747
@Override
2742-
public List<StringRecord> xRevRange(String key, org.springframework.data.domain.Range<String> range, Limit limit) {
2748+
public List<StringRecord> xRevRange(String key, org.springframework.data.domain.Range<String> range,
2749+
org.springframework.data.redis.connection.Limit limit) {
27432750

27442751
return convertAndReturn(delegate.xRevRange(serialize(key), range, limit),
27452752
listByteMapRecordToStringMapRecordConverter);
@@ -2831,7 +2838,8 @@ public PendingMessages xPending(byte[] key, String groupName, XPendingOptions op
28312838
}
28322839

28332840
@Override
2834-
public List<ByteRecord> xRange(byte[] key, org.springframework.data.domain.Range<String> range, Limit limit) {
2841+
public List<ByteRecord> xRange(byte[] key, org.springframework.data.domain.Range<String> range,
2842+
org.springframework.data.redis.connection.Limit limit) {
28352843
return delegate.xRange(key, range, limit);
28362844
}
28372845

@@ -2847,7 +2855,8 @@ public List<ByteRecord> xReadGroup(Consumer consumer, StreamReadOptions readOpti
28472855
}
28482856

28492857
@Override
2850-
public List<ByteRecord> xRevRange(byte[] key, org.springframework.data.domain.Range<String> range, Limit limit) {
2858+
public List<ByteRecord> xRevRange(byte[] key, org.springframework.data.domain.Range<String> range,
2859+
org.springframework.data.redis.connection.Limit limit) {
28512860
return delegate.xRevRange(key, range, limit);
28522861
}
28532862

src/main/java/org/springframework/data/redis/connection/DefaultStringTuple.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717

1818
import java.nio.charset.StandardCharsets;
1919

20-
import org.springframework.data.redis.connection.RedisZSetCommands.Tuple;
2120
import org.springframework.data.redis.connection.StringRedisConnection.StringTuple;
21+
import org.springframework.data.redis.connection.zset.DefaultTuple;
22+
import org.springframework.data.redis.connection.zset.Tuple;
2223
import org.springframework.util.ObjectUtils;
2324

2425
/**

src/main/java/org/springframework/data/redis/connection/DefaultedRedisConnection.java

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
import org.springframework.data.redis.connection.stream.StreamInfo.XInfoStream;
4141
import org.springframework.data.redis.connection.stream.StreamOffset;
4242
import org.springframework.data.redis.connection.stream.StreamReadOptions;
43+
import org.springframework.data.redis.connection.zset.Tuple;
44+
import org.springframework.data.redis.connection.zset.Weights;
4345
import org.springframework.data.redis.core.Cursor;
4446
import org.springframework.data.redis.core.ScanOptions;
4547
import org.springframework.data.redis.core.types.Expiration;
@@ -585,7 +587,8 @@ default List<ByteRecord> xRange(byte[] key, org.springframework.data.domain.Rang
585587
/** @deprecated in favor of {@link RedisConnection#streamCommands()}}. */
586588
@Override
587589
@Deprecated
588-
default List<ByteRecord> xRange(byte[] key, org.springframework.data.domain.Range<String> range, Limit limit) {
590+
default List<ByteRecord> xRange(byte[] key, org.springframework.data.domain.Range<String> range,
591+
org.springframework.data.redis.connection.Limit limit) {
589592
return streamCommands().xRange(key, range, limit);
590593
}
591594

@@ -628,7 +631,8 @@ default List<ByteRecord> xRevRange(byte[] key, org.springframework.data.domain.R
628631
/** @deprecated in favor of {@link RedisConnection#streamCommands()}}. */
629632
@Override
630633
@Deprecated
631-
default List<ByteRecord> xRevRange(byte[] key, org.springframework.data.domain.Range<String> range, Limit limit) {
634+
default List<ByteRecord> xRevRange(byte[] key, org.springframework.data.domain.Range<String> range,
635+
org.springframework.data.redis.connection.Limit limit) {
632636
return streamCommands().xRevRange(key, range, limit);
633637
}
634638

@@ -1137,28 +1141,29 @@ default Set<Tuple> zRangeWithScores(byte[] key, long start, long end) {
11371141
/** @deprecated in favor of {@link RedisConnection#zSetCommands()}}. */
11381142
@Override
11391143
@Deprecated
1140-
default Set<byte[]> zRangeByLex(byte[] key, Range range, Limit limit) {
1144+
default Set<byte[]> zRangeByLex(byte[] key, Range range, org.springframework.data.redis.connection.Limit limit) {
11411145
return zSetCommands().zRangeByLex(key, range, limit);
11421146
}
11431147

11441148
/** @deprecated in favor of {@link RedisConnection#zSetCommands()}}. */
11451149
@Override
11461150
@Deprecated
1147-
default Set<byte[]> zRevRangeByLex(byte[] key, Range range, Limit limit) {
1151+
default Set<byte[]> zRevRangeByLex(byte[] key, Range range, org.springframework.data.redis.connection.Limit limit) {
11481152
return zSetCommands().zRevRangeByLex(key, range, limit);
11491153
}
11501154

11511155
/** @deprecated in favor of {@link RedisConnection#zSetCommands()}}. */
11521156
@Override
11531157
@Deprecated
1154-
default Set<byte[]> zRangeByScore(byte[] key, Range range, Limit limit) {
1158+
default Set<byte[]> zRangeByScore(byte[] key, Range range, org.springframework.data.redis.connection.Limit limit) {
11551159
return zSetCommands().zRangeByScore(key, range, limit);
11561160
}
11571161

11581162
/** @deprecated in favor of {@link RedisConnection#zSetCommands()}}. */
11591163
@Override
11601164
@Deprecated
1161-
default Set<Tuple> zRangeByScoreWithScores(byte[] key, Range range, Limit limit) {
1165+
default Set<Tuple> zRangeByScoreWithScores(byte[] key, Range range,
1166+
org.springframework.data.redis.connection.Limit limit) {
11621167
return zSetCommands().zRangeByScoreWithScores(key, range, limit);
11631168
}
11641169

@@ -1172,14 +1177,15 @@ default Set<Tuple> zRevRangeWithScores(byte[] key, long start, long end) {
11721177
/** @deprecated in favor of {@link RedisConnection#zSetCommands()}}. */
11731178
@Override
11741179
@Deprecated
1175-
default Set<byte[]> zRevRangeByScore(byte[] key, Range range, Limit limit) {
1180+
default Set<byte[]> zRevRangeByScore(byte[] key, Range range, org.springframework.data.redis.connection.Limit limit) {
11761181
return zSetCommands().zRevRangeByScore(key, range, limit);
11771182
}
11781183

11791184
/** @deprecated in favor of {@link RedisConnection#zSetCommands()}}. */
11801185
@Override
11811186
@Deprecated
1182-
default Set<Tuple> zRevRangeByScoreWithScores(byte[] key, Range range, Limit limit) {
1187+
default Set<Tuple> zRevRangeByScoreWithScores(byte[] key, Range range,
1188+
org.springframework.data.redis.connection.Limit limit) {
11831189
return zSetCommands().zRevRangeByScoreWithScores(key, range, limit);
11841190
}
11851191

0 commit comments

Comments
 (0)