mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 18:05:27 +07:00
add doc comment for several factory methods
GitOrigin-RevId: f27bacf90209d9686204369bee91f85cf0440d12
This commit is contained in:
committed by
intellij-monorepo-bot
parent
04185d7432
commit
bc0a67dd04
@@ -14,26 +14,42 @@ import java.util.function.BiConsumer;
|
||||
|
||||
// ContainerUtil requires trove in classpath
|
||||
public final class CollectionFactory {
|
||||
|
||||
/**
|
||||
* Concurrent weak key:K -> strong value:V map.
|
||||
*/
|
||||
@Contract(value = " -> new", pure = true)
|
||||
public static @NotNull <K, V> ConcurrentMap<@NotNull K, @NotNull V> createConcurrentWeakMap() {
|
||||
return new ConcurrentWeakHashMap<>(0.75f);
|
||||
}
|
||||
|
||||
/**
|
||||
* Concurrent weak key:K -> strong value:V map.
|
||||
*/
|
||||
@Contract(value = "_, -> new", pure = true)
|
||||
public static @NotNull <K, V> ConcurrentMap<@NotNull K, @NotNull V> createConcurrentWeakMap(@NotNull HashingStrategy<? super K> strategy) {
|
||||
return new ConcurrentWeakHashMap<>(strategy);
|
||||
}
|
||||
|
||||
/**
|
||||
* Concurrent weak key:String -> strong value:V map with case-insensitive hashing strategy.
|
||||
*/
|
||||
@Contract(value = " -> new", pure = true)
|
||||
public static @NotNull <V> ConcurrentMap<@NotNull String, @NotNull V> createConcurrentWeakCaseInsensitiveMap() {
|
||||
return new ConcurrentWeakHashMap<>(HashingStrategy.caseInsensitive());
|
||||
}
|
||||
|
||||
/**
|
||||
* Concurrent strong key:K -> weak value:V map
|
||||
*/
|
||||
@Contract(value = " -> new", pure = true)
|
||||
public static @NotNull <K, V> ConcurrentMap<@NotNull K, @NotNull V> createConcurrentWeakValueMap() {
|
||||
return new ConcurrentWeakValueHashMap<>(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Concurrent strong key:K -> soft value:V map
|
||||
*/
|
||||
@Contract(value = " -> new", pure = true)
|
||||
public static @NotNull <K, V> ConcurrentMap<@NotNull K, @NotNull V> createConcurrentSoftValueMap() {
|
||||
return new ConcurrentSoftValueHashMap<>(null);
|
||||
@@ -57,6 +73,9 @@ public final class CollectionFactory {
|
||||
return new ConcurrentSoftValueHashMap<>(evictionListener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Concurrent weak key:K -> strong value:V map with identity hashing strategy.
|
||||
*/
|
||||
@Contract(value = " -> new", pure = true)
|
||||
public static @NotNull <K, V> ConcurrentMap<@NotNull K, @NotNull V> createConcurrentWeakIdentityMap() {
|
||||
return new ConcurrentWeakHashMap<>(HashingStrategy.identity());
|
||||
@@ -74,7 +93,7 @@ public final class CollectionFactory {
|
||||
/**
|
||||
* Weak keys hard values hash map.
|
||||
* Null keys are NOT allowed
|
||||
* Null values are allowed
|
||||
* Null values ARE allowed
|
||||
*/
|
||||
@Contract(value = "_,_,_ -> new", pure = true)
|
||||
public static @NotNull <K, V> Map<@NotNull K, V> createWeakMap(int initialCapacity, float loadFactor, @NotNull HashingStrategy<? super K> hashingStrategy) {
|
||||
|
||||
Reference in New Issue
Block a user