Class YangUtils
java.lang.Object
org.opendaylight.ovsdb.utils.yang.YangUtils
YANG utility functions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
K, V> @NonNull Map<K, V> convertYangKeyValueListToMap
(@Nullable Iterable<T> yangList, @NonNull Function<T, K> keyExtractor, @NonNull Function<T, V> valueExtractor) Converts a list of YANG key-value items to a map.static <I extends org.opendaylight.yangtools.yang.binding.Identifier<T>,
T extends org.opendaylight.yangtools.yang.binding.Identifiable<I>, K, V>
@NonNull Map<K,V> convertYangKeyValueListToMap
(@Nullable Map<I, T> yangList, @NonNull Function<T, K> keyExtractor, @NonNull Function<T, V> valueExtractor) Converts a list of YANG key-value items to a map.static <T,
K, V> @NonNull Map<K, V> copyYangKeyValueListToMap
(@NonNull Map<K, V> map, @Nullable Iterable<T> yangList, @NonNull Function<T, K> keyExtractor, @NonNull Function<T, V> valueExtractor) Copies a list of YANG key-value items to the given map.static <I extends org.opendaylight.yangtools.yang.binding.Identifier<T>,
T extends org.opendaylight.yangtools.yang.binding.Identifiable<I>, K, V>
@NonNull Map<K,V> copyYangKeyValueListToMap
(@NonNull Map<K, V> map, @Nullable Map<I, T> yangList, @NonNull Function<T, K> keyExtractor, @NonNull Function<T, V> valueExtractor) Copies a list of YANG key-value items to the given map.
-
Method Details
-
copyYangKeyValueListToMap
public static <T,K, @NonNull Map<K,V> V> copyYangKeyValueListToMap(@NonNull Map<K, V> map, @Nullable Iterable<T> yangList, @NonNull Function<T, K> keyExtractor, @NonNull Function<T, V> valueExtractor) Copies a list of YANG key-value items to the given map. Anynull
key or value will cause an error.- Type Parameters:
T
- The YANG item type.K
- The key type.V
- The value type.- Parameters:
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.- Returns:
- The map.
-
copyYangKeyValueListToMap
public static <I extends org.opendaylight.yangtools.yang.binding.Identifier<T>,T extends org.opendaylight.yangtools.yang.binding.Identifiable<I>, @NonNull Map<K,K, V> V> copyYangKeyValueListToMap(@NonNull Map<K, V> map, @Nullable Map<I, T> yangList, @NonNull Function<T, K> keyExtractor, @NonNull Function<T, V> valueExtractor) Copies a list of YANG key-value items to the given map. Anynull
key or value will cause an error.- Type Parameters:
T
- The YANG item type.K
- The key type.V
- The value type.- Parameters:
map
- The map to fill.yangList
- The map of YANG key-value items.keyExtractor
- The key extractor function to use.valueExtractor
- The value extractor function to use.- Returns:
- The map.
-
convertYangKeyValueListToMap
public static <T,K, @NonNull Map<K,V> V> convertYangKeyValueListToMap(@Nullable Iterable<T> yangList, @NonNull Function<T, K> keyExtractor, @NonNull Function<T, V> valueExtractor) Converts a list of YANG key-value items to a map.- Type Parameters:
T
- The YANG item type.K
- The key type.V
- The value type.- Parameters:
yangList
- The list of YANG key-value items.keyExtractor
- The key extractor function to use.valueExtractor
- The value extractor function to use.- Returns:
- The map.
-
convertYangKeyValueListToMap
public static <I extends org.opendaylight.yangtools.yang.binding.Identifier<T>,T extends org.opendaylight.yangtools.yang.binding.Identifiable<I>, @NonNull Map<K,K, V> V> convertYangKeyValueListToMap(@Nullable Map<I, T> yangList, @NonNull Function<T, K> keyExtractor, @NonNull Function<T, V> valueExtractor) Converts a list of YANG key-value items to a map.- Type Parameters:
T
- The YANG item type.K
- The key type.V
- The value type.- Parameters:
yangList
- The map of YANG key-value items.keyExtractor
- The key extractor function to use.valueExtractor
- The value extractor function to use.- Returns:
- The map.
-