using hutool isInteger()
This commit is contained in:
parent
50747ebcb9
commit
d9ec513913
@ -23,6 +23,7 @@ import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
|
||||
import static cn.hutool.core.util.NumberUtil.isInteger;
|
||||
import static com.xhpc.common.data.redis.StaticBeanUtil.REDIS;
|
||||
import static com.xhpc.evcs.domain.AuthSecretToken.SECRET_TOKEN_TYPE_OUT;
|
||||
import static com.xhpc.evcs.utils.DateUtil.DATE_FORMAT_DATE_TIME;
|
||||
@ -190,31 +191,6 @@ public class NotificationEquipChargeStatusTask extends CoreDispatcher {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isInteger(String str) {
|
||||
|
||||
if (str == null) {
|
||||
return false;
|
||||
}
|
||||
int length = str.length();
|
||||
if (length == 0) {
|
||||
return false;
|
||||
}
|
||||
int i = 0;
|
||||
if (str.charAt(0) == '-') {
|
||||
if (length == 1) {
|
||||
return false;
|
||||
}
|
||||
i = 1;
|
||||
}
|
||||
for (; i < length; i++) {
|
||||
char c = str.charAt(i);
|
||||
if (c < '0' || c > '9') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
DateTime dt = DateTime.now();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user