diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/If.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/If.java index e9945bb2..dd091671 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/If.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/If.java @@ -40,26 +40,41 @@ public class If { } public static boolean isEmpty(T[] array) { - return array != null && array.length == 0; + return array == null || array.length == 0; } + @Deprecated public static boolean isNotEmpty(T[] array) { + return notEmpty(array); + } + + public static boolean notEmpty(T[] array) { return !isEmpty(array); } public static boolean isEmpty(Map map) { - return map != null && map.isEmpty(); + return map == null || map.isEmpty(); } + @Deprecated public static boolean isNotEmpty(Map map) { + return notEmpty(map); + } + + public static boolean notEmpty(Map map) { return !isEmpty(map); } public static boolean isEmpty(Collection collection) { - return collection != null && collection.isEmpty(); + return collection == null || collection.isEmpty(); } + @Deprecated public static boolean isNotEmpty(Collection collection) { + return notEmpty(collection); + } + + public static boolean notEmpty(Collection collection) { return !isEmpty(collection); }