| | |
| | | |
| | | /** |
| | | * 注册对象监听器 |
| | | * |
| | | * <p> |
| | | * key 监听器需开启 `notify-keyspace-events` 等 redis 相关配置 |
| | | * |
| | | * @param key 缓存的键值 |
| | |
| | | |
| | | /** |
| | | * 注册List监听器 |
| | | * |
| | | * <p> |
| | | * key 监听器需开启 `notify-keyspace-events` 等 redis 相关配置 |
| | | * |
| | | * @param key 缓存的键值 |
| | |
| | | |
| | | /** |
| | | * 注册Set监听器 |
| | | * |
| | | * <p> |
| | | * key 监听器需开启 `notify-keyspace-events` 等 redis 相关配置 |
| | | * |
| | | * @param key 缓存的键值 |
| | |
| | | |
| | | /** |
| | | * 注册Map监听器 |
| | | * |
| | | * <p> |
| | | * key 监听器需开启 `notify-keyspace-events` 等 redis 相关配置 |
| | | * |
| | | * @param key 缓存的键值 |
| | |
| | | Iterable<String> iterable = CLIENT.getKeys().getKeysByPattern(pattern); |
| | | return IterUtil.toList(iterable); |
| | | } |
| | | |
| | | /** |
| | | * 检查redis中是否存在key |
| | | * |
| | | * @param key 键 |
| | | */ |
| | | public static Boolean hasKey(String key) { |
| | | RKeys rKeys = CLIENT.getKeys(); |
| | | return rKeys.countExists(key) > 0; |
| | | } |
| | | } |