| | |
| | |
|
| | | /**
|
| | | * Utility class for arrays and collections.
|
| | | * |
| | | *
|
| | | * @author James Moger
|
| | | * |
| | | *
|
| | | */
|
| | | public class ArrayUtils {
|
| | |
|
| | |
| | | public static boolean isEmpty(Object [] array) {
|
| | | return array == null || array.length == 0;
|
| | | }
|
| | | |
| | |
|
| | | public static boolean isEmpty(Collection<?> collection) {
|
| | | return collection == null || collection.size() == 0;
|
| | | }
|
| | | |
| | |
|
| | | public static String toString(Collection<?> collection) {
|
| | | if (isEmpty(collection)) {
|
| | | return "";
|
| | |
| | | sb.setLength(sb.length() - 2);
|
| | | return sb.toString();
|
| | | }
|
| | | |
| | |
|
| | | public static Collection<String> fromString(String value) {
|
| | | if (StringUtils.isEmpty(value)) {
|
| | | value = "";
|