public interface ICollectionUtil
Define common Collection operations
- Since:
- 1.0.0
- Version:
- 1.0.0
- Author:
- yui-KITAMURA
-
Method Summary
Modifier and TypeMethodDescriptionboolean
judge array is empty (null
or length is Zero )boolean
isEmpty
(Collection<?> list) judge Collection is empty<T> ArrayList<T>
toArrayList
(T... aryObj) Convert array toArrayList
<T> List<T>
toList
(T... aryObj) Convert array toList
Array version oftoString(Collection)
toString
(Collection<?> collection) Format collection instance to following format.toStringBr
(Object[] array) Array version oftoStringBr(Collection)
toStringBr
(Collection<?> collection) Format collection instance to following format.Array version oftoStrMeta(Collection)
toStrMeta
(Collection<?> collection) Format collection instance to following format.toStrMetaBr
(Object[] array) Array version oftoStrMetaBr(Collection)
toStrMetaBr
(Collection<?> collection) Format collection instance to following format.
-
Method Details
-
toList
Convert array toList
- Type Parameters:
T
- Type of parameters- Parameters:
aryObj
- values array- Returns:
- an
List
that contains all arguments - See Also:
-
toArrayList
Convert array toArrayList
- Type Parameters:
T
- Type of parameters- Parameters:
aryObj
- values array- Returns:
- an
List
that contains all arguments - See Also:
-
isEmpty
judge array is empty (null
or length is Zero )- Parameters:
array
- target- Returns:
- array is null or nothing in collection then
true
-
isEmpty
judge Collection is empty- Parameters:
list
- target instance- Returns:
- Collection is null or nothing in it then
true
-
toString
Format collection instance to following format.[entity1.toString(), entity2.toString(), ...]
For example, StringBuilder then like[sb1sb1sb1, sb2sb2sb2]
If the entity are the Collection,then call this method for recursively- Parameters:
collection
- a collection instance that format to string- Returns:
- single line string value
-
toString
Array version oftoString(Collection)
- See Also:
-
toStrMeta
Format collection instance to following format.{size: 2, data: [entity1.toString(), entity2.toString()]}
- Parameters:
collection
- a collection instance that format to string- Returns:
- single line string value
-
toStrMeta
Array version oftoStrMeta(Collection)
- See Also:
-
toStringBr
Format collection instance to following format.[ entity1.toString(), entity2.toString(), ... ]
For example, StringBuilder then like[ sb1sb1sb1, sb2sb2sb2 ]
If the entity are the Collection,then call this method for recursively- Parameters:
collection
- a collection instance that format to string- Returns:
- multiple line string value
-
toStringBr
Array version oftoStringBr(Collection)
- See Also:
-
toStrMetaBr
Format collection instance to following format.{ size: 2, data: [ entity1.toString(), entity2.toString() ]}
- Parameters:
collection
- a collection instance that format to string- Returns:
- multiple line string value
-
toStrMetaBr
Array version oftoStrMetaBr(Collection)
- See Also:
-