Improved: Remove UtilValidate::isEmpty(String) method

(OFBIZ-10412)

UtilValidate class contains a `isEmpty` method both for `CharSequence` and for 
`String` types but since the first is an interface for the other and that the 
implementation are the same we don't need to keep the one for the concrete type.

Additionnaly I have removed the unused Generic type for the remaining 
implementation.

Thanks: Mathieu Lirzin

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832170 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2018-05-24 13:36:08 +00:00
parent 3c54a7c761
commit affc8a17cc
@@ -181,11 +181,6 @@ public final class UtilValidate {
return o != null && !o.isEmpty();
}
/** Check whether string s is empty. */
public static boolean isEmpty(String s) {
return (s == null) || s.length() == 0;
}
/** Check whether collection c is empty. */
public static <E> boolean isEmpty(Collection<E> c) {
return (c == null) || c.isEmpty();
@@ -197,22 +192,17 @@ public final class UtilValidate {
}
/** Check whether charsequence c is empty. */
public static <E> boolean isEmpty(CharSequence c) {
public static boolean isEmpty(CharSequence c) {
return (c == null) || c.length() == 0;
}
/** Check whether string s is NOT empty. */
public static boolean isNotEmpty(String s) {
return (s != null) && s.length() > 0;
}
/** Check whether collection c is NOT empty. */
public static <E> boolean isNotEmpty(Collection<E> c) {
return (c != null) && !c.isEmpty();
}
/** Check whether charsequence c is NOT empty. */
public static <E> boolean isNotEmpty(CharSequence c) {
public static boolean isNotEmpty(CharSequence c) {
return ((c != null) && (c.length() > 0));
}