Class DistributedRedisSet
java.lang.Object
io.github.blyznytsiaorg.bibernate.cache.impl.DistributedRedisSet
- All Implemented Interfaces:
DistributedSet
Implementation of the DistributedSet interface using Redis as the distributed cache.
Provides methods for adding entities to Redis and retrieving them.
- Since:
- 1.0
- Author:
- Blyzhnytsia Team
-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
jedis
private final redis.clients.jedis.Jedis jedis
-
-
Constructor Details
-
DistributedRedisSet
public DistributedRedisSet()
-
-
Method Details
-
add
Adds an entity to the Redis cache.- Specified by:
add
in interfaceDistributedSet
- Type Parameters:
T
- the type of the entity- Parameters:
entityClass
- the class of the entitycacheKey
- the cache key associated with the entityentity
- the entity to add to the cache- Throws:
NullPointerException
- if cacheKey or entity is null
-
get
Retrieves an entity from the Redis cache.- Specified by:
get
in interfaceDistributedSet
- Type Parameters:
T
- the type of the entity- Parameters:
entityClass
- the class of the entitycacheKey
- the cache key associated with the entity- Returns:
- an Optional containing the retrieved entity, or empty if not found
- Throws:
NullPointerException
- if entityClass or cacheKey is null
-