4
4
import com .google .common .cache .CacheBuilder ;
5
5
import org .code4everything .boot .cache .guava .GuavaCache ;
6
6
import org .code4everything .boot .cache .guava .GuavaCacheManager ;
7
- import org .code4everything .boot .cache .redis .RedisCache ;
8
- import org .code4everything .boot .cache .redis .RedisCacheCreator ;
9
- import org .code4everything .boot .cache .redis .RedisCacheManager ;
10
7
import org .springframework .cache .Cache ;
11
8
12
9
import java .util .ArrayList ;
@@ -24,72 +21,6 @@ public class CacheUtils {
24
21
25
22
private CacheUtils () {}
26
23
27
- // -------------------------------------------Redis-----------------------------------------------------------------
28
-
29
- /**
30
- * 新建缓存管理器
31
- *
32
- * @param redisCacheCreatorMap 缓存名与缓存创建者的映射
33
- *
34
- * @return 缓存管理器
35
- *
36
- * @since 1.1.3
37
- */
38
- public static RedisCacheManager newRedisCacheManager (Map <String , RedisCacheCreator > redisCacheCreatorMap ) {
39
- return newRedisCacheManager (redisCacheCreatorMap , null );
40
- }
41
-
42
- /**
43
- * 新建缓存管理器
44
- *
45
- * @param redisCacheCreatorMap 缓存名与缓存创建者的映射
46
- * @param defaultRedisCacheCreator 缓存创建者
47
- *
48
- * @return 缓存管理器
49
- *
50
- * @since 1.1.3
51
- */
52
- public static RedisCacheManager newRedisCacheManager (Map <String , RedisCacheCreator > redisCacheCreatorMap ,
53
- RedisCacheCreator defaultRedisCacheCreator ) {
54
- Collection <RedisCache > caches = new ArrayList <>();
55
- redisCacheCreatorMap .forEach ((k , v ) -> caches .add (v .createCache (k )));
56
- return new RedisCacheManager (caches , defaultRedisCacheCreator );
57
- }
58
-
59
- /**
60
- * 新建缓存管理器
61
- *
62
- * @param redisCacheCreator 缓存创建者
63
- * @param names 缓存名集合
64
- *
65
- * @return 缓存管理器
66
- *
67
- * @since 1.1.3
68
- */
69
- public static RedisCacheManager newRedisCacheManager (RedisCacheCreator redisCacheCreator , String ... names ) {
70
- return newRedisCacheManager (redisCacheCreator , Arrays .asList (names ));
71
- }
72
-
73
- /**
74
- * 新建缓存管理器
75
- *
76
- * @param redisCacheCreator 缓存创建者
77
- * @param names 缓存名集合
78
- *
79
- * @return 缓存管理器
80
- *
81
- * @since 1.1.3
82
- */
83
- public static RedisCacheManager newRedisCacheManager (RedisCacheCreator redisCacheCreator ,
84
- Collection <String > names ) {
85
- if (CollUtil .isEmpty (names )) {
86
- return new RedisCacheManager (redisCacheCreator );
87
- }
88
- Collection <RedisCache > caches = new ArrayList <>(names .size ());
89
- names .forEach (name -> caches .add (redisCacheCreator .createCache (name )));
90
- return new RedisCacheManager (caches , redisCacheCreator );
91
- }
92
-
93
24
// ---------------------------------------Guava---------------------------------------------------------------------
94
25
95
26
/**
0 commit comments