[Change] 调整CollectionCacheStore泛型声明以更好的开发对应实现;

[Change] CollectionCacheStore 增加 "C (Collection)" 泛型标记, 使下级接口能具体声明其 Collection 的具体类型;
[Change] ListCacheStore, SetCacheStore 适配更改;
This commit is contained in:
LamGC 2020-09-03 18:04:17 +08:00
parent e98fd82916
commit 3ecaf4db67
Signed by: LamGC
GPG Key ID: 6C5AE2A913941E1D
3 changed files with 3 additions and 3 deletions

View File

@ -24,7 +24,7 @@ import java.util.Collection;
* @param <E> 元素类型.
* @author LamGC
*/
public interface CollectionCacheStore<E> extends CacheStore<Collection<E>> {
public interface CollectionCacheStore<E, C extends Collection<E>> extends CacheStore<C> {
/**
* 为缓存项添加一个元素.

View File

@ -25,7 +25,7 @@ import java.util.List;
* @param <E> 值类型.
* @author LamGC
*/
public interface ListCacheStore<E> extends CollectionCacheStore<E> {
public interface ListCacheStore<E> extends CollectionCacheStore<E, List<E>> {
/**
* 获取缓存项中的指定元素.

View File

@ -24,7 +24,7 @@ import java.util.Set;
* @param <E> 值类型.
* @author LamGC
*/
public interface SetCacheStore<E> extends CollectionCacheStore<E> {
public interface SetCacheStore<E> extends CollectionCacheStore<E, Set<E>> {