com.xiaoleilu.hutool.cache.impl.NoCache Maven / Gradle / Ivy
package com.xiaoleilu.hutool.cache.impl;
import java.util.Iterator;
import com.xiaoleilu.hutool.cache.Cache;
/**
* 无缓存实现,用于快速关闭缓存
* @author Looly,jodd
*
* @param 键类型
* @param 值类型
*/
public class NoCache implements Cache {
@Override
public int capacity() {
return 0;
}
@Override
public long timeout() {
return 0;
}
@Override
public void put(K key, V object) {
// 跳过
}
@Override
public void put(K key, V object, long timeout) {
// 跳过
}
@Override
public boolean containsKey(K key) {
return false;
}
@Override
public V get(K key) {
return null;
}
@Override
public Iterator iterator() {
return null;
}
@Override
public int prune() {
return 0;
}
@Override
public boolean isFull() {
return false;
}
@Override
public void remove(K key) {
// 跳过
}
@Override
public void clear() {
// 跳过
}
@Override
public int size() {
return 0;
}
@Override
public boolean isEmpty() {
return false;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy