mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-04-30 06:37:36 +00:00
[Update] 补充Javadoc, 设置@SuppressWarning注解;
This commit is contained in:
parent
260cfe3dd0
commit
f02b0e9e98
@ -2,6 +2,10 @@ package net.lamgc.cgj.bot.cache;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 缓存库接口
|
||||||
|
* @param <T> 缓存数据类型
|
||||||
|
*/
|
||||||
public interface CacheStore<T> {
|
public interface CacheStore<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,6 +27,7 @@ public class ImageCacheHandler implements EventHandler {
|
|||||||
|
|
||||||
private final static Set<ImageCacheObject> cacheQueue = Collections.synchronizedSet(new HashSet<>());
|
private final static Set<ImageCacheObject> cacheQueue = Collections.synchronizedSet(new HashSet<>());
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
public void getImageToCache(ImageCacheObject event) {
|
public void getImageToCache(ImageCacheObject event) {
|
||||||
if(cacheQueue.contains(event)) {
|
if(cacheQueue.contains(event)) {
|
||||||
log.info("图片 {} 已存在相同缓存任务, 跳过.", event.getStoreFile().getName());
|
log.info("图片 {} 已存在相同缓存任务, 跳过.", event.getStoreFile().getName());
|
||||||
|
@ -7,6 +7,10 @@ import java.util.Hashtable;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基于Hashtable的本地缓存库
|
||||||
|
* @param <T> 缓存类型
|
||||||
|
*/
|
||||||
public class LocalHashCacheStore<T> implements CacheStore<T> {
|
public class LocalHashCacheStore<T> implements CacheStore<T> {
|
||||||
|
|
||||||
private final Hashtable<String, CacheObject<T>> cache;
|
private final Hashtable<String, CacheObject<T>> cache;
|
||||||
|
Loading…
Reference in New Issue
Block a user