K
- The type of the keys in this map.V
- The type of the values in this map.public interface LazyMapI<K,V>
extends java.util.Map<K,V>
Map
interface that introduces the concept of lazy loading.
Implementations of this interface defer the loading of their key-value mappings until they are
actually needed, potentially improving performance and reducing memory consumption, especially
when dealing with relations.
Lazy loading is managed internally by the implementing class. Clients can check the loading
state using isLazy()
and retrieve the expected size without triggering a load via
lazySize()
. The cloneInternalMap()
method forces the loading and provides
a snapshot of the map's contents.
Modifier and Type | Method and Description |
---|---|
java.util.SortedMap |
cloneInternalMap()
Forces the lazy loading of this lazy map, if it hasn't occurred already, and returns a shallow copy
of the internal map that backs this lazy map.
|
boolean |
isLazy()
Checks if the map has not yet been populated with its underlying key-value mappings.
|
default boolean |
lazyIsEmpty()
Returns
true if this map is expected to contain no key-value mappings when fully loaded,
without triggering the loading process. |
int |
lazySize()
Returns the number of key-value mappings that are expected to be in this map once it is fully loaded,
without actually triggering the loading process (i.e., without unlazying the map).
|
boolean isLazy()
true
if the map's content has not been loaded yet, false
otherwise.int lazySize()
java.util.SortedMap cloneInternalMap()
SortedMap
containing the key-value mappings of this lazy map.default boolean lazyIsEmpty()
true
if this map is expected to contain no key-value mappings when fully loaded,
without triggering the loading process. This is a convenience method equivalent to checking if
lazySize()
returns zero.true
if the anticipated size of the map is zero, false
otherwise.Copyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.