File tree Expand file tree Collapse file tree 4 files changed +30
-19
lines changed
src/main/java/com/redislabs/redisgraph Expand file tree Collapse file tree 4 files changed +30
-19
lines changed Original file line number Diff line number Diff line change 77 */
88public interface ResultSet extends Iterator <Record > {
99
10-
11- enum ResultSetScalarTypes {
12- VALUE_UNKNOWN ,
13- VALUE_NULL ,
14- VALUE_STRING ,
15- VALUE_INTEGER ,
16- VALUE_BOOLEAN ,
17- VALUE_DOUBLE ,
18- VALUE_ARRAY ,
19- VALUE_EDGE ,
20- VALUE_NODE
21- }
22-
23-
2410 int size ();
2511
2612 Statistics getStatistics ();
Original file line number Diff line number Diff line change 11package com .redislabs .redisgraph .graph_entities ;
22
3-
4- import com .redislabs .redisgraph .ResultSet .ResultSetScalarTypes ;
5-
63import java .util .*;
74
85
Original file line number Diff line number Diff line change 11package com .redislabs .redisgraph .impl .resultset ;
22
3- import com .redislabs .redisgraph .*;
3+ import com .redislabs .redisgraph .Header ;
4+ import com .redislabs .redisgraph .Record ;
5+ import com .redislabs .redisgraph .RedisGraph ;
6+ import com .redislabs .redisgraph .ResultSet ;
7+ import com .redislabs .redisgraph .Statistics ;
48import com .redislabs .redisgraph .graph_entities .Edge ;
59import com .redislabs .redisgraph .graph_entities .GraphEntity ;
610import com .redislabs .redisgraph .graph_entities .Node ;
@@ -254,7 +258,7 @@ private List<Object> deserializeArray(Object rawScalarData) {
254258 * @return scalar type
255259 */
256260 private ResultSetScalarTypes getValueTypeFromObject (Object rawScalarType ) {
257- return ResultSetScalarTypes .values ()[ ((Long ) rawScalarType ).intValue ()] ;
261+ return ResultSetScalarTypes .getValue ( ((Long ) rawScalarType ).intValue ()) ;
258262 }
259263
260264 @ Override
Original file line number Diff line number Diff line change 1+ package com .redislabs .redisgraph .impl .resultset ;
2+
3+ import redis .clients .jedis .exceptions .JedisDataException ;
4+
5+ enum ResultSetScalarTypes {
6+ VALUE_UNKNOWN ,
7+ VALUE_NULL ,
8+ VALUE_STRING ,
9+ VALUE_INTEGER ,
10+ VALUE_BOOLEAN ,
11+ VALUE_DOUBLE ,
12+ VALUE_ARRAY ,
13+ VALUE_EDGE ,
14+ VALUE_NODE ;
15+
16+
17+ static ResultSetScalarTypes [] values = values ();
18+
19+ public static ResultSetScalarTypes getValue (int index ) {
20+ if (index < 0 || index > values .length ) throw new JedisDataException ("Unrecognized response type" );
21+ return values [index ];
22+ }
23+
24+ }
You can’t perform that action at this time.
0 commit comments