杰客网络

杰客网络个人博客

常用工具类

Java 0 评
public static boolean isDateYM(String argYm) {

    if (!StringUtils.isEmpty(argYm) && argYm.length() == 6) {
        if (NumberUtils.isDigits(argYm)) {
            if (NumberUtils.toInt(argYm.substring(4, 6)) <= 12) {
                return true;
            }
        }
    }
    return false;
}

使用JodaTime处理时间

<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.9</version>

    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.8</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.6</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>1.18.8</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
    </dependency>

hutool

依赖

<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.4.3</version>

官网

https://www.hutool.cn/docs/#/?id=%e6%96%87%e6%a1%a3
https://gitee.com/loolly/hutool

JOOQ学习