You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Memoize calls to `Consumer`, `Function`, `Predicate`, `Supplier` and other functional interfaces in `java.util.function`
13
-
* Cache values using [Caffeine](https://github.com/ben-manes/caffeine), [Guava](https://github.com/google/guava/wiki/CachesExplained), or any [`ConcurrentMap`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ConcurrentMap.html).
13
+
* Cache values using [Caffeine](https://github.com/ben-manes/caffeine), [Guava](https://github.com/google/guava/wiki/CachesExplained), [cache2k](https://cache2k.org/), or any [`ConcurrentMap`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ConcurrentMap.html).
14
14
* Customize caches and the cache keys
15
15
16
16
## Usage
17
17
18
18
Memoize any of the supported types by using the static factory methods supplied by:
19
19
20
+
*`Cache2kMemoize` if you want to use [cache2k](https://cache2k.org/) caches.
20
21
*`CaffeineMemoize` if you want to use [Caffeine](https://github.com/ben-manes/caffeine) caches.
21
22
*`GuavaMemoize` if you want to use [Guava](https://github.com/google/guava/wiki/CachesExplained) caches.
22
23
*`MapMemoize` if you want to use any [`ConcurrentMap`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ConcurrentMap.html) as cache.
@@ -121,44 +146,63 @@ In order to use this project, declare the following dependencies in your project
121
146
122
147
```xml
123
148
<dependencies>
124
-
<!-- ConcurrentMap ONLY -->
125
-
<dependency>
126
-
<groupId>wtf.metio.memoization</groupId>
127
-
<artifactId>memoization-map</artifactId>
128
-
<version>${version.memoization}</version>
129
-
</dependency>
130
-
<!-- ConcurrentMap ONLY -->
131
-
132
-
<!-- Caffeine ONLY -->
133
-
<dependency>
134
-
<groupId>wtf.metio.memoization</groupId>
135
-
<artifactId>memoization-caffeine</artifactId>
136
-
<version>${version.memoization}</version>
137
-
</dependency>
138
-
<dependency>
139
-
<groupId>com.github.ben-manes.caffeine</groupId>
140
-
<artifactId>caffeine</artifactId>
141
-
<version>${version.caffeine}</version>
142
-
</dependency>
143
-
<!-- Caffeine ONLY -->
144
-
145
-
<!-- Guava ONLY -->
146
-
<dependency>
147
-
<groupId>wtf.metio.memoization</groupId>
148
-
<artifactId>memoization-guava</artifactId>
149
-
<version>${version.memoization}</version>
150
-
</dependency>
151
-
<dependency>
152
-
<groupId>com.google.guava</groupId>
153
-
<artifactId>guava</artifactId>
154
-
<version>${version.guava}</version>
155
-
</dependency>
156
-
<!-- Guava ONLY -->
149
+
<!-- ConcurrentMap ONLY -->
150
+
<dependency>
151
+
<groupId>wtf.metio.memoization</groupId>
152
+
<artifactId>memoization-map</artifactId>
153
+
<version>${version.memoization}</version>
154
+
</dependency>
155
+
<!-- ConcurrentMap ONLY -->
156
+
157
+
<!-- cache2k ONLY -->
158
+
<dependency>
159
+
<groupId>wtf.metio.memoization</groupId>
160
+
<artifactId>memoization-cache2k</artifactId>
161
+
<version>${version.memoization}</version>
162
+
</dependency>
163
+
<dependency>
164
+
<groupId>org.cache2k</groupId>
165
+
<artifactId>cache2k-api</artifactId>
166
+
<version>${version.cache2k}</version>
167
+
</dependency>
168
+
<dependency>
169
+
<groupId>org.cache2k</groupId>
170
+
<artifactId>cache2k-core</artifactId>
171
+
<version>${version.cache2k}</version>
172
+
<scope>runtime</scope>
173
+
</dependency>
174
+
<!-- cache2k ONLY -->
175
+
176
+
<!-- Caffeine ONLY -->
177
+
<dependency>
178
+
<groupId>wtf.metio.memoization</groupId>
179
+
<artifactId>memoization-caffeine</artifactId>
180
+
<version>${version.memoization}</version>
181
+
</dependency>
182
+
<dependency>
183
+
<groupId>com.github.ben-manes.caffeine</groupId>
184
+
<artifactId>caffeine</artifactId>
185
+
<version>${version.caffeine}</version>
186
+
</dependency>
187
+
<!-- Caffeine ONLY -->
188
+
189
+
<!-- Guava ONLY -->
190
+
<dependency>
191
+
<groupId>wtf.metio.memoization</groupId>
192
+
<artifactId>memoization-guava</artifactId>
193
+
<version>${version.memoization}</version>
194
+
</dependency>
195
+
<dependency>
196
+
<groupId>com.google.guava</groupId>
197
+
<artifactId>guava</artifactId>
198
+
<version>${version.guava}</version>
199
+
</dependency>
200
+
<!-- Guava ONLY -->
157
201
158
202
</dependencies>
159
203
```
160
204
161
-
Replace `${version.memoization}` with the latest release. Use [ExpiringMap](https://github.com/jhalterman/expiringmap), [ConcurrentLinkedHashMap](https://github.com/ben-manes/concurrentlinkedhashmap), [Chronicle-Map](https://github.com/OpenHFT/Chronicle-Map), [Cacheonix](http://www.cacheonix.org/) or other `ConcurrentMap` implementations as alternatives to the default `ConcurrentHashMap` used in the `MapMemoize` factory. Caches like [cache2k](http://cache2k.org/) can be used together with `MapMemoize` by calling `cache.asMap()`.
205
+
Replace `${version.memoization}` with the latest release. Use [ExpiringMap](https://github.com/jhalterman/expiringmap), [ConcurrentLinkedHashMap](https://github.com/ben-manes/concurrentlinkedhashmap), [Chronicle-Map](https://github.com/OpenHFT/Chronicle-Map), [Cacheonix](http://www.cacheonix.org/) or other `ConcurrentMap` implementations as alternatives to the default `ConcurrentHashMap` used in the `MapMemoize` factory.
0 commit comments