T
- The type of the serialized form.public interface MapLike<T>
Modifier and Type | Method and Description |
---|---|
Stream<(T,T)> |
entries()
Returns a fresh
Stream of all the entries in this map. |
static <T> MapLike<T> |
forMap(Map<T,T> map,
DynamicOps<T> ops)
|
T |
get(String key)
Retrieves the value corresponding to the given key, or
null if there is no mapping for the given key. |
T |
get(T key)
Retrieves the value corresponding to the given key, or
null if there is no mapping for the given key. |
@Nullable T get(T key)
null
if there is no mapping for the given key.
Note that, unlike Map.get(Object)
, a return value of null
should only occur if this map
truly does not contain a mapping.key
- The serialized key.null
if the entry does not exist.@Nullable T get(String key)
null
if there is no mapping for the given key.
Note that, unlike Map.get(Object)
, a return value of null
should only occur if this map
truly does not contain a mapping.
The argument should be the String
representation of a serialized key.
key
- The string key.null
if the entry does not exist.static <T> MapLike<T> forMap(Map<T,T> map, DynamicOps<T> ops)
MapLike
containing the entries of the given Map
.
The map is not defensively copied, so modifications to the map are reflected in the returned MapLike
.
T
- The type of the serialized form.map
- The map to wrap.ops
- A DynamicOps
instance defining the serialized form.MapLike
containing the entries of the given map.