com.github.javaclub.sword.cache.CacheRefreshKeys Maven / Gradle / Ivy
The newest version!
/*
* @(#)CacheRefreshKeys.java 2017年6月2日
*
* Copyright (c) 2017. All Rights Reserved.
*
*/
package com.github.javaclub.sword.cache;
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
import com.google.common.collect.Maps;
/**
* CacheRefreshKeys
*
* @author Gerald Chen
* @version $Id: CacheRefreshKeys.java 2017年6月2日 10:38:16 Exp $
*/
public class CacheRefreshKeys {
private static CacheRefreshKeys instance = new CacheRefreshKeys();
private ConcurrentMap keysMap = Maps.newConcurrentMap();
private CacheRefreshKeys() {
}
public static CacheRefreshKeys getInstance() {
return instance;
}
public void put(String key) {
keysMap.putIfAbsent(key, key);
}
public Set keys() {
return keysMap.keySet();
}
}