Object, or use @Nullable Object to allow null values.
Map, the additional type-safe
operations putInstance and getInstance are available.
Like any other Map<Class, Object>, this map may contain entries for primitive types,
and a primitive type and its corresponding wrapper type may map to different values.
To map a generic type to an instance of that type, use com. instead.
See the Guava User Guide article on ClassToInstanceMap.
| Modifier and Type | Method and Description |
|---|---|
| public <T extends @NonNull B> T | getInstance(Class<T> type)
Returns the value the specified class is mapped to, or |
| public <T extends B> T | Returns: the value previously associated with this class (possiblynull), or null if there was no previous entry.Maps the specified class to the specified value. |
| getInstance | back to summary |
|---|---|
| public <T extends @NonNull B> T getInstance(Class<T> type) Returns the value the specified class is mapped to, or
| |
| putInstance | back to summary |
|---|---|
| public <T extends B> T putInstance(Class<@NonNull T> type, T value) Maps the specified class to the specified value. Does not associate this value with any of the class's supertypes.
| |