mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
util: LinkedHashMap from pairs
This commit is contained in:
@@ -61,7 +61,8 @@ public class ContainerUtilRt {
|
||||
return map;
|
||||
}
|
||||
|
||||
public static <K, V> Map<K,V> newHashMap(Pair<K, V> first, Pair<K, V>[] entries) {
|
||||
@NotNull
|
||||
public static <K, V> Map<K,V> newHashMap(@NotNull Pair<K, V> first, Pair<K, V>[] entries) {
|
||||
Map<K, V> map = newHashMap();
|
||||
map.put(first.getFirst(), first.getSecond());
|
||||
for (Pair<K, V> entry : entries) {
|
||||
@@ -90,6 +91,16 @@ public class ContainerUtilRt {
|
||||
return new com.intellij.util.containers.LinkedHashMap<K, V>(map);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static <K, V> LinkedHashMap<K,V> newLinkedHashMap(@NotNull Pair<K, V> first, Pair<K, V>[] entries) {
|
||||
LinkedHashMap<K, V> map = newLinkedHashMap();
|
||||
map.put(first.getFirst(), first.getSecond());
|
||||
for (Pair<K, V> entry : entries) {
|
||||
map.put(entry.getFirst(), entry.getSecond());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static <T> LinkedList<T> newLinkedList() {
|
||||
return new LinkedList<T>();
|
||||
|
||||
@@ -55,7 +55,7 @@ public class ContainerUtil extends ContainerUtilRt {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static <K, V> Map<K, V> newHashMap(Pair<K, V> first, Pair<K, V>... entries) {
|
||||
public static <K, V> Map<K, V> newHashMap(@NotNull Pair<K, V> first, Pair<K, V>... entries) {
|
||||
return ContainerUtilRt.newHashMap(first, entries);
|
||||
}
|
||||
|
||||
@@ -84,6 +84,11 @@ public class ContainerUtil extends ContainerUtilRt {
|
||||
return ContainerUtilRt.newLinkedHashMap(map);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static <K, V> LinkedHashMap<K, V> newLinkedHashMap(@NotNull Pair<K, V> first, Pair<K, V>... entries) {
|
||||
return ContainerUtilRt.newLinkedHashMap(first, entries);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static <K, V> THashMap<K, V> newTroveMap() {
|
||||
return new THashMap<K, V>();
|
||||
|
||||
Reference in New Issue
Block a user