Package org.opendaylight.yangtools.util
Class LazyCollections
java.lang.Object
org.opendaylight.yangtools.util.LazyCollections
Utility methods for lazily instantiated collections. These are useful for situations when we start off with an empty
collection (where Collections.empty() * can be reused), but need to add more things.
-
Method Summary
-
Method Details
-
lazyAdd
Add an element to a list, potentially transforming the list.- Type Parameters:
E
- the type of elements in the list- Parameters:
list
- Current listobj
- Object that needs to be added- Returns:
- new list
-
lazyAdd
Add an element to a set, potentially transforming the set.- Type Parameters:
E
- the type of elements in the set- Parameters:
set
- Current setobj
- Object that needs to be added- Returns:
- new set
-