Package org.opendaylight.yangtools.util
Class LazyCollections
- java.lang.Object
-
- org.opendaylight.yangtools.util.LazyCollections
-
public final class LazyCollections extends Object
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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <E> List<E>
lazyAdd(List<E> list, E obj)
Add an element to a list, potentially transforming the list.static <E> Set<E>
lazyAdd(Set<E> set, E obj)
Add an element to a set, potentially transforming the set.
-