| 650 | } |
| 651 | |
| 652 | public <K, T> Dict putToMap(Prop<? extends Map<String, T>> key, K tok, T value) { |
| 653 | if (key.toCanon().autoConstructor != null) { |
| 654 | Map<K, T> c = (Map<K, T>) dictionary.computeIfAbsent(key, (k) -> key.toCanon().autoConstructor.get()); |
| 655 | c.put(tok, value); |
| 656 | return this; |
| 657 | } else { |
| 658 | Map<K, T> c = (Map<K, T>) dictionary.computeIfAbsent(key, (k) -> new IdempotencyMap<T>(null)); |
| 659 | c.put(tok, value); |
| 660 | return this; |
| 661 | } |
| 662 | } |
| 663 | |
| 664 | public <K, T> T getFromMap(Prop<? extends Map<String, T>> key, K tok) { |
| 665 | Map<K, T> c = (Map<K, T>) get(key); |