[Update] 补充Javadoc, 设置@SuppressWarning注解;

This commit is contained in:
LamGC 2020-04-18 01:13:01 +08:00
parent 260cfe3dd0
commit f02b0e9e98
3 changed files with 9 additions and 0 deletions

View File

@ -2,6 +2,10 @@ package net.lamgc.cgj.bot.cache;
import java.util.Date;
/**
* 缓存库接口
* @param <T> 缓存数据类型
*/
public interface CacheStore<T> {
/**

View File

@ -27,6 +27,7 @@ public class ImageCacheHandler implements EventHandler {
private final static Set<ImageCacheObject> cacheQueue = Collections.synchronizedSet(new HashSet<>());
@SuppressWarnings("unused")
public void getImageToCache(ImageCacheObject event) {
if(cacheQueue.contains(event)) {
log.info("图片 {} 已存在相同缓存任务, 跳过.", event.getStoreFile().getName());

View File

@ -7,6 +7,10 @@ import java.util.Hashtable;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;
/**
* 基于Hashtable的本地缓存库
* @param <T> 缓存类型
*/
public class LocalHashCacheStore<T> implements CacheStore<T> {
private final Hashtable<String, CacheObject<T>> cache;