Git Product home page Git Product logo

cuis-common's Introduction

Cuis Common — Java 常用工具类合集

1. 功能列表

  1. 时间操作(DateUtils)

2. 如何使用

[tags] 添加依赖

# 克隆项目本地安装
git https://github.com/li7nux/cuis-common.git
cd cuis-common
mvn clean install

# 在项目中引用
# maven
<dependency>
    <groupId>me.olddriver.cuis</groupId>
    <artifactId>common</artifactId>
    <version>1.0-SNAPSHOT</version>
</dependency>
# gradle
compile 'me.olddriver.cuis:common:1.0-SNAPSHOT'

2.1. 常用的时间操作(DateUtils)

// 按指定格式进行时间格式化
DateUtils.formatDate(new Date(), DateUtils.sf);
// 按固定格式将字符串解析成时间
DateUtils.parseDate("20171229", DateUtils.df);
Tip
更多例子查看 DateUtilsTest

2.2. MD5 加密工具类(MD5Util)

MD5Util.encrypt("12345");
Tip
更多例子查看 MD5UtilTest

2.3. Json 工具类(基于Jackson)(JsonUtils)

// Java 对象转成 Json 字符串
JsonUtils.toJsonString(vo);
Tip
更多例子查看 JsonUtilsTest

2.4. 数字处理工具类(NumberFormatUtils)

// 保留 2 位小数,不够补0
NumberFormatUtils.formatDecimalWithZero(new BigDecimal(35.8), 2);
Tip
更多例子查看 NumberFormatUtilsTest

cuis-common's People

Contributors

li7nux avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.