Commit b41768b5 authored by liaozan's avatar liaozan 🏀

Polish

parent b1730bd1
...@@ -41,7 +41,7 @@ public class StreamUtils { ...@@ -41,7 +41,7 @@ public class StreamUtils {
return filter(data, predicate, mapper, Collectors.toSet()); return filter(data, predicate, mapper, Collectors.toSet());
} }
public static <T, E, V, R> R filter(Iterable<T> data, Predicate<T> predicate, Function<T, V> valueMapper, Collector<V, ?, R> collector) { public static <T, V, R> R filter(Iterable<T> data, Predicate<T> predicate, Function<T, V> valueMapper, Collector<V, ?, R> collector) {
return from(data).filter(predicate).map(valueMapper).collect(collector); return from(data).filter(predicate).map(valueMapper).collect(collector);
} }
......
...@@ -25,6 +25,13 @@ public class CacheUtils { ...@@ -25,6 +25,13 @@ public class CacheUtils {
CacheUtils.cacheProvider = cacheProvider; CacheUtils.cacheProvider = cacheProvider;
} }
/**
* 缓存是否存在
*/
public static boolean hasKey(String cacheKey) {
return getCacheProvider().hasKey(cacheKey);
}
/** /**
* 缓存是否过期 * 缓存是否过期
*/ */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment