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
{{ message }}
This repository was archived by the owner on Oct 16, 2024. It is now read-only.
Copy file name to clipboardexpand all lines: README.md
+19
Original file line number
Diff line number
Diff line change
@@ -365,6 +365,24 @@ A <code>[Map][]</code> property called 'albums' would generate:
365
365
|`clearAlbums()`| Removes all mappings from albums, leaving it empty. |
366
366
|`albums()`| Returns an unmodifiable view of the map of albums. Changes to the map held by the builder will be reflected in this view. |
367
367
368
+
```java
369
+
/** Returns a bimap of favourite albums by year. **/
370
+
BiMap<Integer, String> albums();
371
+
```
372
+
373
+
A <code>[BiMap][]</code> property called 'albums' would generate:
374
+
375
+
| Method | Description |
376
+
|:------:| ----------- |
377
+
|`putAlbums(int key, String value)`| Associates `key` with `value` in albums. Throws a NullPointerException if either parameter is null, or an IllegalArgumentException if `value` is already bound to a different key. Replaces any existing entry for `key`. |
378
+
|`forcePutAlbums(int key, String value)`| Associates `key` with `value` in albums. Throws a NullPointerException if either parameter is null. Replaces any existing entry for both `key`_and_`value`. _Override this method to implement [constraint checks](#defaults-and-constraints)._|
379
+
|`putAllAlbums(Map<? extends Integer, ? extends String> map)`| Associates all of `map`'s keys and values in albums. Throws a NullPointerException if the map is null or contains a null key or value. Replaces any existing mapping for all keys in `map`. Throws an IllegalArgumentException if an attempt to put any entry fails. |
380
+
|`removeKeyFromAlbums(int key)`| Removes the mapping for `key` from albums. Throws a NullPointerException if the parameter is null. Does nothing if the key is not present. |
381
+
|`removeValueFromAlbums(String value)`| Removes the mapping for `value` from albums. Throws a NullPointerException if the parameter is null. Does nothing if the value is not present. |
382
+
|`mutateAlbums(Consumer<BiMap<Integer, String>> mutator)`| Invokes the [Consumer]`mutator` with the bimap of albums. Throws a NullPointerException if `mutator` is null. As `mutator` is a void consumer, any value returned from a lambda will be ignored, so be careful not to call pure functions like [stream()] expecting the returned map to replace the existing map. |
383
+
|`clearAlbums()`| Removes all mappings from albums, leaving it empty. |
384
+
|`albums()`| Returns an unmodifiable view of the bimap of albums. Changes to the bimap held by the builder will be reflected in this view. |
0 commit comments