public class CollectionUtil extends Object
Constructor and Description |
---|
CollectionUtil() |
Modifier and Type | Method and Description |
---|---|
static Object |
addArrays(Object first,
Object second) |
static EventBean[] |
addArrayWithSetSemantics(EventBean[] arrayOne,
EventBean[] arrayTwo) |
static void |
addEventByKeyLazyListMapBack(Object sortKey,
EventBean eventBean,
Map<Object,Object> eventMap) |
static void |
addEventByKeyLazyListMapFront(Object key,
EventBean bean,
Map<Object,Object> eventMap) |
static int[] |
addValue(int[] ints,
int i) |
static Object[] |
addValue(Object[] values,
Object value) |
static String[] |
appendArrayConditional(String[] appendedTo,
boolean test,
String appended) |
static String[] |
appendArrayConditional(String appendedTo,
boolean test,
String appended) |
static Object |
arrayExpandAddElements(Object array,
Collection elementsToAdd) |
static Object |
arrayExpandAddElements(Object array,
Object[] elementsToAdd) |
static Object |
arrayExpandAddSingle(Object array,
Object elementsToAdd) |
static Object |
arrayShrinkRemoveSingle(Object array,
int index) |
static Collection |
arrayToCollectionAllowNull(Object array) |
static CodegenExpression |
arrayToCollectionAllowNullCodegen(CodegenMethodScope codegenMethodScope,
Class arrayType,
CodegenExpression array,
CodegenClassScope codegenClassScope) |
static Map<String,Object> |
buildMap(Object... pairs) |
static Map<String,Object> |
buildMap(Object[][] entries) |
static int |
capacityHashMap(int expectedSize) |
static boolean |
compare(String[] otherIndexProps,
String[] thisIndexProps) |
static int |
compareValues(Object valueOne,
Object valueTwo,
boolean isDescending)
Compares two nullable values.
|
static int |
compareValuesCollated(Object valueOne,
Object valueTwo,
boolean isDescending,
Collator collator)
Compares two nullable values using Collator, for use with string-typed values.
|
static String[] |
copyAndSort(String[] input)
Copy an sort the input array.
|
static String[] |
copyArray(String[] arrayToCopy) |
static String[] |
copySortArray(String[] values) |
static int |
findItem(String[] items,
String item) |
static int[] |
intArray(Collection<Integer> set)
Returns an array of integer values from the set of integer values
|
static boolean |
isAllNullArray(Object array) |
static boolean |
isAnySet(boolean[] array) |
static Collection |
iterableToCollection(Iterable iterable)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
static EventBean[] |
iteratorToArrayEvents(Iterator<EventBean> iterator)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
static Map<String,Object> |
populateNameValueMap(Object... values) |
static boolean |
removeEventByKeyLazyListMap(Object key,
EventBean bean,
Map<Object,Object> eventMap) |
static <T> int |
searchArray(T[] array,
T item) |
static EventBean[][] |
shrinkArrayEventArray(int count,
EventBean[][] eventArrays)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
static EventBean[] |
shrinkArrayEvents(int count,
EventBean[] events)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
static Object[] |
shrinkArrayObjects(int count,
Object[] keys)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
static boolean |
sortCompare(String[] valuesOne,
String[] valuesTwo) |
static String[] |
toArray(Collection<String> strings) |
static EventBean[] |
toArrayEvents(Collection<EventBean> events)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
static EventBean[][] |
toArrayEventsArray(ArrayDeque<EventBean[]> arrays)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
static EventBean[] |
toArrayMayNull(Collection<EventBean> collection)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
static EventBean[] |
toArrayMayNull(EventBean event) |
static EventBean[] |
toArrayNullForEmptyEvents(Collection<EventBean> events)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
static Object[] |
toArrayNullForEmptyObjects(Collection<Object> values)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
static EventBean[] |
toArrayNullForEmptyValueEvents(Map<Object,EventBean> events)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
static Object[] |
toArrayNullForEmptyValueValues(Map<Object,Object> values)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
static Object[] |
toArrayObjects(List<Object> values)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
static String |
toString(Collection<Integer> stack,
String delimiterChars) |
static <T> String |
toString(Collection<T> collection)
Returns a list of the elements invoking toString on non-null elements.
|
static String |
toStringArray(Object[] received) |
static <K,V> Map<K,V> |
twoEntryMap(K k1,
V v1,
K k2,
V v2) |
public static final String METHOD_SHRINKARRAYEVENTS
public static final String METHOD_SHRINKARRAYEVENTARRAY
public static final String METHOD_SHRINKARRAYOBJECTS
public static final String METHOD_TOARRAYEVENTS
public static final String METHOD_TOARRAYOBJECTS
public static final String METHOD_TOARRAYEVENTSARRAY
public static final String METHOD_TOARRAYNULLFOREMPTYEVENTS
public static final String METHOD_TOARRAYNULLFOREMPTYOBJECTS
public static final String METHOD_TOARRAYNULLFOREMPTYVALUEEVENTS
public static final String METHOD_TOARRAYNULLFOREMPTYVALUEVALUES
public static final String METHOD_TOARRAYMAYNULL
public static final String METHOD_ITERATORTOARRAYEVENTS
public static final SortedMap EMPTY_SORTED_MAP
public static final EventBean[] EVENTBEANARRAY_EMPTY
public static final EventBean[][] EVENTBEANARRAYARRAY_EMPTY
public static final String[] STRINGARRAY_EMPTY
public static final Object[] OBJECTARRAY_EMPTY
public static final Object[][] OBJECTARRAYARRAY_EMPTY
public static final CodegenExpression EMPTY_LIST_EXPRESSION
public static final StopCallback STOP_CALLBACK_NONE
public static String toString(Collection<Integer> stack, String delimiterChars)
public static Object arrayExpandAddElements(Object array, Object[] elementsToAdd)
public static Object arrayExpandAddElements(Object array, Collection elementsToAdd)
public static int[] addValue(int[] ints, int i)
public static int[] intArray(Collection<Integer> set)
set
- to return array forpublic static <T> String toString(Collection<T> collection)
T
- typecollection
- to renderpublic static boolean isAllNullArray(Object array)
public static EventBean[] toArrayNullForEmptyEvents(Collection<EventBean> events)
events
- eventspublic static Object[] toArrayNullForEmptyObjects(Collection<Object> values)
values
- valuespublic static EventBean[] addArrayWithSetSemantics(EventBean[] arrayOne, EventBean[] arrayTwo)
public static String[] toArray(Collection<String> strings)
public static EventBean[] toArrayEvents(Collection<EventBean> events)
events
- valuespublic static Object[] toArrayObjects(List<Object> values)
values
- valuespublic static EventBean[][] toArrayEventsArray(ArrayDeque<EventBean[]> arrays)
arrays
- valuespublic static <T> int searchArray(T[] array, T item)
public static boolean removeEventByKeyLazyListMap(Object key, EventBean bean, Map<Object,Object> eventMap)
public static void addEventByKeyLazyListMapBack(Object sortKey, EventBean eventBean, Map<Object,Object> eventMap)
public static void addEventByKeyLazyListMapFront(Object key, EventBean bean, Map<Object,Object> eventMap)
public static boolean isAnySet(boolean[] array)
public static <K,V> Map<K,V> twoEntryMap(K k1, V v1, K k2, V v2)
public static Collection arrayToCollectionAllowNull(Object array)
public static CodegenExpression arrayToCollectionAllowNullCodegen(CodegenMethodScope codegenMethodScope, Class arrayType, CodegenExpression array, CodegenClassScope codegenClassScope)
public static Collection iterableToCollection(Iterable iterable)
iterable
- iterablepublic static int capacityHashMap(int expectedSize)
public static EventBean[] toArrayMayNull(Collection<EventBean> collection)
collection
- collectionpublic static EventBean[] shrinkArrayEvents(int count, EventBean[] events)
count
- cntevents
- eventspublic static Object[] shrinkArrayObjects(int count, Object[] keys)
count
- cntkeys
- valuespublic static EventBean[][] shrinkArrayEventArray(int count, EventBean[][] eventArrays)
count
- cnteventArrays
- eventspublic static EventBean[] toArrayNullForEmptyValueEvents(Map<Object,EventBean> events)
events
- eventspublic static Object[] toArrayNullForEmptyValueValues(Map<Object,Object> values)
values
- eventspublic static EventBean[] iteratorToArrayEvents(Iterator<EventBean> iterator)
iterator
- iteratorpublic static int compareValuesCollated(Object valueOne, Object valueTwo, boolean isDescending, Collator collator)
valueOne
- first value to comparevalueTwo
- second value to compareisDescending
- true for descendingcollator
- the Collator for comparingpublic static int compareValues(Object valueOne, Object valueTwo, boolean isDescending)
valueOne
- first value to comparevalueTwo
- second value to compareisDescending
- true for descendingpublic static String[] appendArrayConditional(String[] appendedTo, boolean test, String appended)
public static String[] appendArrayConditional(String appendedTo, boolean test, String appended)
Copyright © 2005–2018. All rights reserved.