public final class YangUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <T,K,V> Map<K,V> |
convertYangKeyValueListToMap(Iterable<T> yangList,
Function<T,K> keyExtractor,
Function<T,V> valueExtractor)
Converts a list of YANG key-value items to a map.
|
static <T,K,V> Map<K,V> |
copyYangKeyValueListToMap(Map<K,V> map,
Iterable<T> yangList,
Function<T,K> keyExtractor,
Function<T,V> valueExtractor)
Copies a list of YANG key-value items to the given map.
|
@Nonnull public static <T,K,V> Map<K,V> copyYangKeyValueListToMap(@Nonnull Map<K,V> map, @Nullable Iterable<T> yangList, @Nonnull Function<T,K> keyExtractor, @Nonnull Function<T,V> valueExtractor)
null
key or value will cause an error.T
- The YANG item type.K
- The key type.V
- The value type.map
- The map to fill.yangList
- The list of YANG key-value items.keyExtractor
- The key extractor function to use.valueExtractor
- The value extractor function to use.@Nonnull public static <T,K,V> Map<K,V> convertYangKeyValueListToMap(@Nullable Iterable<T> yangList, @Nonnull Function<T,K> keyExtractor, @Nonnull Function<T,V> valueExtractor)
T
- The YANG item type.K
- The key type.V
- The value type.yangList
- The list of YANG key-value items.keyExtractor
- The key extractor function to use.valueExtractor
- The value extractor function to use.Copyright © 2018 OpenDaylight. All rights reserved.