Sets a new value onto the Deque for the given TypedKey. This is effectively a shortcut for calling pop(key) followed by push(key, value). This has the same effects as pop of not throwing an error if the Deque is currently empty. @param key The TypeKey for which the given value should be
(TypedKey<T> key, T value)
| 133 | * Deque |
| 134 | */ |
| 135 | public <T> void set(TypedKey<T> key, T value) |
| 136 | { |
| 137 | Deque<Object> dq = getDeque(Objects.requireNonNull(key)); |
| 138 | if (!dq.isEmpty()) |
| 139 | { |
| 140 | dq.pop(); |
| 141 | } |
| 142 | dq.push(wrap(value)); |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * Returns a Deque for the given TypedKey, building and storing it if the |