|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.bamboo.util.BambooCollectionUtils
public class BambooCollectionUtils
Method Summary | ||
---|---|---|
static
|
addIgnoreNull(Collection<? super E> collection,
E element)
Add element to the collection if it is not null. |
|
static
|
contains(Collection<T> collection,
Object object)
|
|
static List<String> |
convertToList(String s)
|
|
static
|
get(List<? extends E> list,
int index)
Get Nth element from list or null if list hasn't got so many elements |
|
static
|
newHashSet(Collection<T> collection)
|
|
static
|
newImmutableList(Collection<T> collection)
|
|
static
|
nullToEmptyImmutable(List<T> list)
|
|
static
|
nullToEmptyImmutable(Map<K,V> map)
|
|
static
|
nullToEmptyImmutable(Set<T> set)
|
|
static
|
removeDuplicates(List<T> input)
|
|
static
|
removeDuplicatesAndSort(List<T> input)
|
|
static
|
removeDuplicatesAndSort(List<T> input,
Comparator<? super T> c)
|
|
static
|
sortByValue(Map<K,V> map)
Given a map returns the list of entries in the map sorted by Entry.getValue() in descending order. |
|
static Set<String> |
stringArrayToHashSet(String[] values)
|
|
static List<String> |
stringArrayToList(String[] s)
|
|
static List<String> |
stringToCollection(String s)
Converts a string with a given pattern into a Collection of strings. |
|
static
|
subtract(Collection<T> a,
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 |
Method Detail |
---|
@NotNull public static List<String> stringToCollection(String s)
s
- string to be analyzed
@NotNull public static List<String> stringArrayToList(@Nullable String[] s)
@NotNull public static Set<String> stringArrayToHashSet(@Nullable String[] values)
@Nullable public static <T> List<T> removeDuplicates(@Nullable List<T> input)
@Nullable public static <T extends Comparable<? super T>> List<T> removeDuplicatesAndSort(List<T> input)
@Nullable public static <T> List<T> removeDuplicatesAndSort(List<T> input, @NotNull Comparator<? super T> c)
@Nullable public static List<String> convertToList(@Nullable String s)
@NotNull public static <T> List<T> subtract(@NotNull Collection<T> a, @NotNull Collection<T> b)
T
- any typea
- collection Ab
- collection B
public static <K,V extends Comparable<? super V>> List<Map.Entry<K,V>> sortByValue(Map<K,V> map)
map
-
public static <E> boolean addIgnoreNull(@NotNull Collection<? super E> collection, @Nullable 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 List<? extends E> list, int index)
E
- Type of the elements in the listlist
- List to get element fromindex
- Index of element to get
@NotNull public static <T> List<T> nullToEmptyImmutable(@Nullable List<T> list)
@NotNull public static <T> Set<T> nullToEmptyImmutable(@Nullable Set<T> set)
@NotNull public static <K,V> Map<K,V> nullToEmptyImmutable(@Nullable Map<K,V> map)
public static <T> boolean contains(@Nullable Collection<T> collection, Object object)
@NotNull public static <T> com.google.common.collect.ImmutableList<T> newImmutableList(@Nullable Collection<T> collection)
public static <T> HashSet<T> newHashSet(Collection<T> collection)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |