public interface RedisConnection<K,V>
这个接口代表一次 Redis 连接
这个接口存在的意义在于:
你可以使用我默认的 redis 加载器,但是我是用 Jedis 的, 如果你不喜欢使用它,就需要自己自定义一个加载器,尽管你只是不喜欢其中一个小零件。 所以我将 redis 连接抽象出来,这样你只需要替换掉我默认的 redis 实现即可
This interface represents one time of redis connection
The meaning of it is :
You may not like my default redis loader because it is using Jedis, then you may rewrite redis loader by yourself, although it is a small class... So I take it out and make it abstract, then you just implement it
Email: fishinlove@163.com
created by 2019/04/26 11:51:32
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
断开连接
Close the connection
|
boolean |
containsKey(K key)
判断一个 key 是否存在
Judge the key that exists or not
|
V |
get(K key)
根据 key 获得一个值
Get a value by given key
|
V |
put(K key,
V value)
用给定的 key 和 value 保存一个值
Put an entry by given key and value
|
void |
putAll(java.util.Map<? extends K,? extends V> map)
将一个 Map 保存到 redis
Put the whole map to redis
|
V |
remove(K key)
删除指定 key 的数据
Remove the given value of given key
|
V get(K key)
根据 key 获得一个值
Get a value by given key
key - 给定的 key
Given key
返回获取到的值
Return result
boolean containsKey(K key)
判断一个 key 是否存在
Judge the key that exists or not
key - 要被判断的 key
Given key
true 存在,反之不存在
true if exists, false if not exists
V put(K key, V value)
用给定的 key 和 value 保存一个值
Put an entry by given key and value
key - 给定的 key
Given key
value - 给定的 value
Given value
可能是返回保存的值?
May be the given value?
void putAll(java.util.Map<? extends K,? extends V> map)
将一个 Map 保存到 redis
Put the whole map to redis
map - 要被保存的 map
The given map
V remove(K key)
删除指定 key 的数据
Remove the given value of given key
key - 指定的 key
Given key
返回这个被移除的值
Return the removed value
void close()
断开连接
Close the connection
Copyright © 2019. All Rights Reserved.