Package ru.cwcode.cwutils.collections
Class CollectionUtils
java.lang.Object
ru.cwcode.cwutils.collections.CollectionUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> intstatic <T> Collection<T>combine(Collection<T>... lists) static <T> booleancontainsAny(Collection<T> one, Collection<T> two) Используйте HashSet для параметров, если коллекции достаточно большиеstatic <T> intstatic intgetFirstAvailableID(Collection<Integer> ids, int minID) static <T> TgetRandomArrayEntry(T... values) static <T> TgetRandomListEntry(List<T> list) static <T> TgetRandomWeightedElement(Collection<T> elements, Function<T, ? extends Number> chanceExtractor) static <T> TgetRandomWeightedElement(Map<T, ? extends Number> map) static StringgetStringOfArray(Object[] values) Deprecated, for removal: This API element is subject to removal in a future version.static <T> booleanhasAllElements(Collection<T> toCheck, Collection<T> elements) Используйте HashSet для параметров, если коллекции достаточно большиеstatic <T> intstatic voidshuffleArray(int[] ar) Deprecated.static <T> T[]shuffleArray(T[] array) static <T> Stringstatic <T> Stringstatic Stringstatic Stringstatic <T> StringtoString(Collection<T> values) static <T> StringtoString(Collection<T> values, String prefix, String suffix, boolean removeLastSuffix) static <T> Stringstatic <T> StringtoStringList(Collection<?> collection)
-
Constructor Details
-
CollectionUtils
public CollectionUtils()
-
-
Method Details
-
getRandomListEntry
-
getRandomArrayEntry
-
shuffleArray
Deprecated. -
shuffleArray
public static <T> T[] shuffleArray(T[] array) -
combine
-
containsAny
Используйте HashSet для параметров, если коллекции достаточно большие -
hasAllElements
Используйте HashSet для параметров, если коллекции достаточно большие -
toString
-
getStringOfArray
Deprecated, for removal: This API element is subject to removal in a future version. -
toString
-
toString
-
toString
-
toString
-
toString
-
toString
public static <T> String toString(Collection<T> values, String prefix, String suffix, boolean removeLastSuffix) -
toString
-
increment
-
add
-
decrement
-
getRandomWeightedElement
-
getRandomWeightedElement
public static <T> T getRandomWeightedElement(Collection<T> elements, Function<T, ? extends Number> chanceExtractor) -
getFirstAvailableID
-
toStringList
-