Class ReflectionBasedRedisClient
java.lang.Object
org.evomaster.client.java.controller.redis.ReflectionBasedRedisClient
RedisClient that uses Lettuce dynamically via reflection, avoiding
compile-time dependency on Spring or Lettuce.
-
Constructor Summary
ConstructorsConstructorDescriptionReflectionBasedRedisClient(String host, int port, int keyspace) Creates the Redis connection. -
Method Summary
Modifier and TypeMethodDescriptionvoidSADD keyvoidclose()voidflushAll()Equivalent to KEYS *getHashFields(String key) getHashValue(String key, String field) Equivalent to HGET key fieldgetKeysByType(String expectedType) getSetMembers(String key) SMEMBERS keyEquivalent to TYPE keyEquivalent to GET keyvoidHSET key field valuevoidselect(int keyspace) Selects the logical database for subsequent commands on this connection.voidEquivalent to SET key value
-
Constructor Details
-
ReflectionBasedRedisClient
Creates the Redis connection.- Parameters:
host- Redis database host.port- Redis database port.keyspace- Logical database index. Default is 0.
-
-
Method Details
-
close
public void close() -
select
public void select(int keyspace) Selects the logical database for subsequent commands on this connection.Redis supports multiple logical databases identified by a zero-based integer index, referred to as a keyspace. All keys are scoped to the selected keyspace, meaning that the same key can exist independently in different keyspaces. The default keyspace is 0.
- Parameters:
keyspace- the zero-based index of the logical database to select
-
setValue
Equivalent to SET key value -
getValue
Equivalent to GET key -
getHashValue
Equivalent to HGET key field -
getAllKeys
Equivalent to KEYS * -
getType
Equivalent to TYPE key -
hashSet
HSET key field value -
addMember
SADD key -
getSetMembers
SMEMBERS key -
getKeysByType
-
flushAll
public void flushAll() -
getHashFields
-