forked from devonfw/IDEasy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devonfw#103: rephrase interaction, mapUtil, LICENCE
also SecurityRiskInteraction returns configured version and latest version when possible. conversion between cpe and ulr version more rebust by using map and inverse function where map fails. Added asciidoc
- Loading branch information
1 parent
1b9224b
commit 9a86e34
Showing
10 changed files
with
441 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.devonfw.tools.ide.util; | ||
|
||
import java.util.HashMap; | ||
import java.util.Iterator; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* Utility class for operations on maps. | ||
*/ | ||
public class MapUtil { | ||
|
||
/** | ||
* Creates a {@link HashMap} with the given {@code keys} and {@code values} which are passed as {@link List lists}. | ||
* The map is populated by iterating through both lists simultaneously until one of the list is exhausted. | ||
*/ | ||
public static <K, V> Map<K, V> createMapWithLists(List<K> keys, List<V> values) { | ||
|
||
Map<K, V> resultMap = new HashMap<>(); | ||
|
||
// Create iterators for both lists | ||
Iterator<K> keysIterator = keys.iterator(); | ||
Iterator<V> valuesIterator = values.iterator(); | ||
|
||
// Iterate through both iterators simultaneously | ||
while (keysIterator.hasNext() && valuesIterator.hasNext()) { | ||
K key = keysIterator.next(); | ||
V value = valuesIterator.next(); | ||
resultMap.put(key, value); | ||
} | ||
|
||
return resultMap; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.