4
4
import java .util .*;
5
5
import java .util .stream .Collectors ;
6
6
7
- import redis .clients .jedis .resps .StreamConsumerFullInfo ;
8
- import redis .clients .jedis .resps .StreamFullInfo ;
9
- import redis .clients .jedis .resps .StreamGroupFullInfo ;
7
+ import redis .clients .jedis .resps .*;
10
8
import redis .clients .jedis .resps .LCSMatchResult .MatchedPosition ;
11
9
import redis .clients .jedis .resps .LCSMatchResult .Position ;
12
- import redis .clients .jedis .resps .*;
13
10
import redis .clients .jedis .util .DoublePrecision ;
14
11
import redis .clients .jedis .util .JedisByteHashMap ;
15
12
import redis .clients .jedis .util .KeyValue ;
@@ -200,36 +197,6 @@ public String toString() {
200
197
}
201
198
};
202
199
203
- // TODO: remove
204
- public static final Builder <byte []> BYTE_ARRAY = new Builder <byte []>() {
205
- @ Override
206
- public byte [] build (Object data ) {
207
- return ((byte []) data );
208
- }
209
-
210
- @ Override
211
- public String toString () {
212
- return "byte[]" ;
213
- }
214
- };
215
-
216
- // TODO: remove
217
- public static final Builder <List <byte []>> BYTE_ARRAY_LIST = new Builder <List <byte []>>() {
218
- @ Override
219
- @ SuppressWarnings ("unchecked" )
220
- public List <byte []> build (Object data ) {
221
- if (null == data ) {
222
- return null ;
223
- }
224
- return (List <byte []>) data ;
225
- }
226
-
227
- @ Override
228
- public String toString () {
229
- return "List<byte[]>" ;
230
- }
231
- };
232
-
233
200
public static final Builder <byte []> BINARY = new Builder <byte []>() {
234
201
@ Override
235
202
public byte [] build (Object data ) {
@@ -308,7 +275,7 @@ public Map<byte[], byte[]> build(Object data) {
308
275
309
276
@ Override
310
277
public String toString () {
311
- return "Map<String, String >" ;
278
+ return "Map<byte[], byte[] >" ;
312
279
}
313
280
};
314
281
@@ -977,7 +944,7 @@ private Map<String, Builder> createDecoderMap() {
977
944
tempMappingFunctions .put (AccessControlLogEntry .CONTEXT , STRING );
978
945
tempMappingFunctions .put (AccessControlLogEntry .OBJECT , STRING );
979
946
tempMappingFunctions .put (AccessControlLogEntry .USERNAME , STRING );
980
- // tempMappingFunctions.put(AccessControlLogEntry.AGE_SECONDS, STRING );
947
+ tempMappingFunctions .put (AccessControlLogEntry .AGE_SECONDS , DOUBLE );
981
948
tempMappingFunctions .put (AccessControlLogEntry .CLIENT_INFO , STRING );
982
949
tempMappingFunctions .put (AccessControlLogEntry .ENTRY_ID , LONG );
983
950
tempMappingFunctions .put (AccessControlLogEntry .TIMESTAMP_CREATED , LONG );
@@ -1174,7 +1141,7 @@ public List<Map.Entry<String, List<StreamEntry>>> build(Object data) {
1174
1141
List <Object > stream = (List <Object >) streamObj ;
1175
1142
String streamKey = STRING .build (stream .get (0 ));
1176
1143
List <StreamEntry > streamEntries = STREAM_ENTRY_LIST .build (stream .get (1 ));
1177
- result .add (new AbstractMap . SimpleEntry <> (streamKey , streamEntries ));
1144
+ result .add (KeyValue . of (streamKey , streamEntries ));
1178
1145
}
1179
1146
1180
1147
return result ;
@@ -1198,7 +1165,7 @@ public List<Map.Entry<String, List<StreamEntry>>> build(Object data) {
1198
1165
while (iter .hasNext ()) {
1199
1166
String streamKey = STRING .build (iter .next ());
1200
1167
List <StreamEntry > streamEntries = STREAM_ENTRY_LIST .build (iter .next ());
1201
- result .add (new AbstractMap . SimpleEntry <> (streamKey , streamEntries ));
1168
+ result .add (KeyValue . of (streamKey , streamEntries ));
1202
1169
}
1203
1170
1204
1171
return result ;
0 commit comments