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:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user