File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -46,9 +46,9 @@ In `Map.Entry`:
46
46
47
47
## processing
48
48
* ` default void forEach(BiConsumer<? super K, ? super V> action) `
49
+ * ` default V getOrDefault(Object key, V defaultValue) `
49
50
50
51
# modifying
51
- * ` default V getOrDefault(Object key, V defaultValue) `
52
52
* ` default V putIfAbsent(K key, V value) `
53
53
* ` default boolean remove(Object key, Object value) `
54
54
* ` default void replaceAll(BiFunction<? super K, ? super V, ? extends V> function) `
@@ -83,4 +83,17 @@ We provide tests for above mentioned methods.
83
83
* print all entries
84
84
```
85
85
customerMap.forEach((key, value) -> System.out.println(key + ": " + value));
86
- ```
86
+ ```
87
+ * get customer (id = 1) from map or default to EMPTY customer
88
+ ```
89
+ @Value
90
+ class Customer {
91
+ public static final Customer EMPTY = new Customer(0);
92
+
93
+ Integer id;
94
+ }
95
+ ```
96
+ ```
97
+ customerMap.getOrDefault(1, Customer.EMPTY);
98
+ ```
99
+ 1. modifying
You can’t perform that action at this time.
0 commit comments