|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.bamboo.util.BambooCollectionUtils
public class BambooCollectionUtils
Constructor Summary | |
---|---|
BambooCollectionUtils()
|
Method Summary | ||
---|---|---|
static
|
addIgnoreNull(java.util.Collection<? super E> collection,
E element)
Add element to the collection if it is not null. |
|
static java.util.List<java.lang.String> |
convertToList(java.lang.String s)
|
|
static
|
get(java.util.List<? extends E> list,
int index)
Get Nth element from list or null if list hasn't got so many elements |
|
static
|
newArrayList(java.lang.Iterable<? extends E> elements,
java.util.Comparator<? super E> comparator)
Deprecated. since 3.0 use Ordering.sortedCopy |
|
static
|
newLinkedList(java.lang.Iterable<? extends E> elements,
java.util.Comparator<? super E> comparator)
Deprecated. since 3.0 use Ordering.sortedCopy |
|
static
|
removeDuplicates(java.util.List<T> input)
|
|
static
|
removeDuplicatesAndSort(java.util.List<T> input)
|
|
static
|
removeDuplicatesAndSort(java.util.List<T> input,
java.util.Comparator<? super T> c)
|
|
static
|
sortByValue(java.util.Map<K,V> map)
Given a map returns the list of entries in the map sorted by Entry.getValue() in descending order. |
|
static java.util.Set<java.lang.String> |
stringArrayToHashSet(java.lang.String[] values)
|
|
static java.util.List<java.lang.String> |
stringArrayToList(java.lang.String[] s)
|
|
static java.util.List<java.lang.String> |
stringToCollection(java.lang.String s)
Converts a string with a given pattern into a Collection of strings. |
|
static
|
subtract(java.util.Collection<T> a,
java.util.Collection<T> b)
Generic version of ListUtils.subtract |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BambooCollectionUtils()
Method Detail |
---|
@NotNull public static java.util.List<java.lang.String> stringToCollection(java.lang.String s)
s
- string to be analyzed
@NotNull public static java.util.List<java.lang.String> stringArrayToList(@Nullable java.lang.String[] s)
@NotNull public static java.util.Set<java.lang.String> stringArrayToHashSet(@Nullable java.lang.String[] values)
@Nullable public static <T> java.util.List<T> removeDuplicates(@Nullable java.util.List<T> input)
@Nullable public static <T extends java.lang.Comparable<? super T>> java.util.List<T> removeDuplicatesAndSort(java.util.List<T> input)
@Nullable public static <T> java.util.List<T> removeDuplicatesAndSort(java.util.List<T> input, @NotNull java.util.Comparator<? super T> c)
@Nullable public static java.util.List<java.lang.String> convertToList(@Nullable java.lang.String s)
@NotNull public static <T> java.util.List<T> subtract(@NotNull java.util.Collection<T> a, @NotNull java.util.Collection<T> b)
T
- any typea
- collection Ab
- collection B
@Deprecated public static <E> java.util.List<E> newArrayList(@NotNull java.lang.Iterable<? extends E> elements, @NotNull java.util.Comparator<? super E> comparator)
elements
- Elements to be copiedcomparator
- Comparator used for sorting
@Deprecated public static <E> java.util.List<E> newLinkedList(@NotNull java.lang.Iterable<? extends E> elements, @NotNull java.util.Comparator<? super E> comparator)
elements
- Elements to be copiedcomparator
- Comparator used for sorting
public static <K,V extends java.lang.Comparable<? super V>> java.util.List<java.util.Map.Entry<K,V>> sortByValue(java.util.Map<K,V> map)
map
-
public static <E> boolean addIgnoreNull(@NotNull java.util.Collection<? super E> collection, E element)
E
- Element typecollection
- Collection where element will be added toelement
- Element to be added to the collection
@Nullable public static <E> E get(@NotNull java.util.List<? extends E> list, int index)
E
- Type of the elements in the listlist
- List to get element fromindex
- Index of element to get
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |