Author: chris.laprun(a)jboss.com
Date: 2009-10-13 10:17:18 -0400 (Tue, 13 Oct 2009)
New Revision: 339
Modified:
components/common/trunk/common/src/main/java/org/gatein/common/util/ParameterValidation.java
Log:
- Added existsAndIsNotEmpty for arrays as well.
Modified:
components/common/trunk/common/src/main/java/org/gatein/common/util/ParameterValidation.java
===================================================================
---
components/common/trunk/common/src/main/java/org/gatein/common/util/ParameterValidation.java 2009-10-13
13:27:59 UTC (rev 338)
+++
components/common/trunk/common/src/main/java/org/gatein/common/util/ParameterValidation.java 2009-10-13
14:17:18 UTC (rev 339)
@@ -178,6 +178,11 @@
return map != null && !map.isEmpty();
}
+ public static <T> boolean existsAndIsNotEmpty(T[] array)
+ {
+ return array != null && array.length > 0;
+ }
+
/**
* Checks if a given value matches the given format (as a regular expression). If yes,
returns it as is. Otherwise,
* returns the default value.
Show replies by date