Skip to content

Commit 7ac1805

Browse files
committed
FT.CONFIG GET result parser: STRING_MAP_FROM_PAIRS
1 parent eca8a68 commit 7ac1805

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

driver/src/main/java/jdbc/client/result/parser/ResultParserFactory.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,18 @@ boolean isRaw() {
173173
}
174174
};
175175

176+
public static final ResultParser STRING_MAP_FROM_PAIRS = new MapResultParser<String, String>() {
177+
@Override
178+
protected @NotNull MapEncoder<String> getEncoder() {
179+
return EncoderFactory.STRING_MAP_FROM_PAIRS;
180+
}
181+
182+
@Override
183+
protected @NotNull SimpleConverter<String, String> getConverter() {
184+
return ConverterFactory.STRING;
185+
}
186+
};
187+
176188

177189
/* ------------------------------------------------- Native ------------------------------------------------- */
178190

driver/src/main/java/jdbc/client/result/parser/ResultParsers.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ private ResultParsers() {
397397
CRP_MAP.put(RedisCommands.FT_ALIASDEL, STRING);
398398
CRP_MAP.put(RedisCommands.FT_ALIASUPDATE, STRING);
399399
CRP_MAP.put(RedisCommands.FT_ALTER, STRING);
400-
CRP_MAP.put(RedisCommands.FT_CONFIG_GET, STRING_MAP);
400+
CRP_MAP.put(RedisCommands.FT_CONFIG_GET, STRING_MAP_FROM_PAIRS);
401401
CRP_MAP.put(RedisCommands.FT_CONFIG_SET, STRING);
402402
CRP_MAP.put(RedisCommands.FT_CREATE, STRING);
403403
CRP_MAP.put(RedisCommands.FT_CURSOR_DEL, STRING);

driver/src/main/java/jdbc/client/result/parser/encoder/EncoderFactory.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@ private EncoderFactory() {
144144
}
145145
};
146146

147+
public static final MapEncoder<String> STRING_MAP_FROM_PAIRS = new SimpleMapEncoder<>() {
148+
@Override
149+
protected @NotNull Builder<Map<String, String>> getMapBuilder() {
150+
return BuilderFactory.STRING_MAP_FROM_PAIRS;
151+
}
152+
};
153+
147154

148155
/* ------------------------------------------------- Native ------------------------------------------------- */
149156

0 commit comments

Comments
 (0)