Package com.couchbase.client.core.util
Interface IntMap<E>
A read-only map where the keys are non-negative integers.
-
Method Summary
Modifier and TypeMethodDescriptionReturns a new instance where the values are the values of the given enum class, and the associated key is derived by applying the given function to the value.static <E> IntMap<E>
Returns a new instance where the values are the values of the given iterable, and the associated key is derived by applying the given function to the value.static <E> IntMap<E>
Returns a new instance from the entries of the given map.default E
get
(byte key) Reinterprets the byte as a positive integer, then returns the value associated with the given integer, or null if not found.get
(int key) Returns the value associated with the given integer, or null if not found.default E
get
(short key) Reinterprets the short as a positive integer, then returns the value associated with the given integer, or null if not found.
-
Method Details
-
get
Returns the value associated with the given integer, or null if not found.- Parameters:
key
- the non-negative integer associated with the value to return- Throws:
IllegalArgumentException
- if the given key is negative.
-
get
Reinterprets the short as a positive integer, then returns the value associated with the given integer, or null if not found.- Parameters:
key
- the short associated with the value to return
-
get
Reinterprets the byte as a positive integer, then returns the value associated with the given integer, or null if not found.- Parameters:
key
- the byte associated with the value to return
-
from
Returns a new instance where the values are the values of the given enum class, and the associated key is derived by applying the given function to the value.- Throws:
IllegalArgumentException
- if a derived key is negative, null, or not unique
-
from
Returns a new instance where the values are the values of the given iterable, and the associated key is derived by applying the given function to the value.- Throws:
IllegalArgumentException
- if a derived key is negative, null, or not unique
-
from
Returns a new instance from the entries of the given map.- Throws:
IllegalArgumentException
- if the map contains a key that is null or negative.
-