温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

JAVA中常用的类库整理

发布时间:2021-09-07 10:19:47 来源:亿速云 阅读:95 作者:chen 栏目:大数据

这篇文章主要介绍“JAVA中常用的类库整理”,在日常操作中,相信很多人在JAVA中常用的类库整理问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”JAVA中常用的类库整理”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

JAVA类库整理

标签(空格分隔): 技术栈


[toc]

commons-codec

加解密功能封装 例:

<dependency>
    <groupId>commons-codec</groupId>
    <artifactId>commons-codec</artifactId>
    <version>1.12</version>
</dependency>
/*
 * MD5加密
 */
DigestUtils.md5Hex("123456")

commons-lang3

工具类封装 例:

<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-lang3</artifactId>
    <version>3.9</version>
</dependency>
public static void main(String[] args) {
    System.out.println(StringUtils.isEmpty(null));
    System.out.println(StringUtils.isEmpty(""));

    System.out.println(ObjectUtils.anyNotNull(null, null));
    System.out.println(ObjectUtils.anyNotNull(11, null));

    System.out.println(RandomUtils.nextBoolean());
    System.out.println(RandomUtils.nextBoolean());

    System.out.println(SystemUtils.JAVA_HOME);
}

commons-io

IO工具封装(FileUtils、IOUtils等) 例:

<dependency>
    <groupId>commons-io</groupId>
    <artifactId>commons-io</artifactId>
    <version>2.6</version>
</dependency>

commons-collections4

集合功能封装 例:

<dependency>
	<groupId>org.apache.commons</groupId>
	<artifactId>commons-collections4</artifactId>
	<version>4.0</version>
</dependency>

commons-pool

<dependency>
    <groupId>commons-pool</groupId>
    <artifactId>commons-pool</artifactId>
    <version>1.6</version>
</dependency>

commons-beanutils

Apache开源组织提供的用于操作JAVA BEAN的工具包

<dependency>
    <groupId>commons-beanutils</groupId>
    <artifactId>commons-beanutils</artifactId>
    <version>1.9.3</version>
</dependency>

pagehelper

MyBatis 分页插件

<dependency>
  <groupId>com.github.pagehelper</groupId>
  <artifactId>pagehelper</artifactId>
  <version>4.1.6</version>
</dependency>

java-jwt

<dependency>
    <groupId>com.auth0</groupId>
    <artifactId>java-jwt</artifactId>
    <version>3.8.1</version>
</dependency>

reflections

<dependency>
    <groupId>org.reflections</groupId>
    <artifactId>reflections</artifactId>
    <version>0.9.10</version>
</dependency>

hutool-all

<dependency>
    <groupId>cn.hutool</groupId>
    <artifactId>hutool-all</artifactId>
    <version>4.6.1</version>
</dependency>

hibernate-validator

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator</artifactId>
    <version>6.0.17.Final</version>
</dependency>

metrics 监控

<dependency>
    <groupId>io.dropwizard.metrics</groupId>
    <artifactId>metrics-core</artifactId>
    <version>${metrics.version}</version>
</dependency>

Lombok

Lombok能以简单的注解形式来简化java代码,提高开发人员的开发效率

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.16.20</version>
    <scope>provided</scope>
</dependency>

注解:

@Data

Spring-Boot-Starter-Slf4j

减少编写日志的组件

<dependency>
    <groupId>wiki.xsx</groupId>
    <artifactId>spring-boot-starter-slf4j</artifactId>
    <version>RELEASE</version>
</dependency>

到此,关于“JAVA中常用的类库整理”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI