This commit is contained in:
6
pom.xml
6
pom.xml
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>com.imyeyu.java</groupId>
|
||||
<artifactId>timi-java</artifactId>
|
||||
<version>0.0.4</version>
|
||||
<version>0.0.5</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
@@ -50,7 +50,7 @@
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.36</version>
|
||||
<version>1.18.46</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
@@ -92,7 +92,7 @@
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.40</version>
|
||||
<version>1.18.46</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
|
||||
@@ -72,6 +72,30 @@ public interface TimiJava {
|
||||
return !isEmpty(object);
|
||||
}
|
||||
|
||||
static boolean hasEmpty(Object... objects) {
|
||||
for (Object object : objects) {
|
||||
if (isEmpty(object)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static boolean allNotEmpty(Object... objects) {
|
||||
for (Object object : objects) {
|
||||
if (isEmpty(object)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
static <T> T nullIfEmpty(T object) {
|
||||
if (isEmpty(object)) {
|
||||
return null;
|
||||
}
|
||||
return object;
|
||||
}
|
||||
|
||||
/**
|
||||
* 为空时取默认值
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user