/java-fun

Java with Fun (Functions) is a small and useful Java util library.

Primary LanguageJavaApache License 2.0Apache-2.0

Java With Fun (Functions)

Java with Fun (Functions) is a small and useful Java util library.

English | 简体中文

Install

<dependency>
  <groupId>io.github.x-funs</groupId>
  <artifactId>java-fun</artifactId>
  <version>${java-fun.version}</version>
</dependency>

Usage

import io.github.xfuns.java.Fun;

public class JavaFun {
    public static void main(String[] args) {
        // whether the string is empty after trim (blank or not)
        System.out.println(Fun.blank("java-fun"));

        // return string md5 hash
        System.out.println(Fun.md5("java-fun"));
    
        // parse string to integer
        System.out.println(Fun.toInt("42"));
    
        // auto parse many datetime string to long timestamp
        System.out.println(Fun.strtotime("2015-04-06 16:03:03"));
    }
}