File tree 2 files changed +17
-6
lines changed
src/main/java/com/fasterxml/jackson/databind/util 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -74,12 +74,7 @@ public V putIfAbsent(K key, V value) {
74
74
@ Override
75
75
public int size () { return _map .size (); }
76
76
77
- /*
78
- /**********************************************************************
79
- /* Extended API (2.14)
80
- /**********************************************************************
81
- */
82
-
77
+ @ Override
83
78
public void contents (BiConsumer <K ,V > consumer ) {
84
79
for (Map .Entry <K ,V > entry : _map .entrySet ()) {
85
80
consumer .accept (entry .getKey (), entry .getValue ());
Original file line number Diff line number Diff line change 1
1
package com .fasterxml .jackson .databind .util ;
2
2
3
+ import java .util .function .BiConsumer ;
4
+
3
5
/**
4
6
* An interface describing the required API for the Jackson-databind Type cache.
5
7
*<p>
11
13
*/
12
14
public interface LookupCache <K ,V >
13
15
{
16
+ /**
17
+ * Method to apply operation on cache contents without exposing them.
18
+ *<p>
19
+ * Default implementation throws {@link UnsupportedOperationException}.
20
+ * Implementations are required to override this method.
21
+ *
22
+ * @since 2.16
23
+ * @throws UnsupportedOperationException if implementation does not override this method.
24
+ * @param consumer Operation to apply on cache contents.
25
+ */
26
+ default void contents (BiConsumer <K ,V > consumer ) {
27
+ throw new UnsupportedOperationException ();
28
+ }
29
+
14
30
/**
15
31
* Method needed for creating clones but without contents.
16
32
*<p>
You can’t perform that action at this time.
0 commit comments