Class CollectionsSync
java.lang.Object
ushiosan.jvm_utilities.lang.collection.CollectionsSync
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> @NotNull Collection<T>collectionOf(@NotNull Collection<T> base) Create a mutable synchronized collection with all given elements.Create a mutable synchronized list with all given elements.Create a mutable synchronized map with all the given elements.Create a mutable synchronized map with all the given elements.Create a mutable synchronized set with all given elements.
-
Method Details
-
collectionOf
@NotNull public static <T> @NotNull Collection<T> collectionOf(@NotNull @NotNull Collection<T> base) Create a mutable synchronized collection with all given elements.- Type Parameters:
T- collection generic type- Parameters:
base- the elements to insert- Returns:
- a mutable synchronized collection with all elements
-
listOf
Create a mutable synchronized list with all given elements.- Type Parameters:
T- list generic type- Parameters:
elements- the elements to insert- Returns:
- a mutable synchronized list with all elements
-
setOf
Create a mutable synchronized set with all given elements.- Type Parameters:
T- list generic type- Parameters:
elements- the elements to insert- Returns:
- a mutable synchronized set with all elements
-
mapOf
@SafeVarargs @NotNull public static <K,V> @NotNull Map<K,V> mapOf(Map.Entry<K, V> @NotNull ... entries) Create a mutable synchronized map with all the given elements.- Type Parameters:
K- key entry typeV- value entry type- Parameters:
entries- the elements to insert- Returns:
- a mutable synchronized map with all content
-
mapOf
Create a mutable synchronized map with all the given elements.- Type Parameters:
K- key entry typeV- value entry type- Parameters:
pairs- the elements to insert- Returns:
- a mutable synchronized map with all content
-