![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java工具类
残云卷
这个作者很懒,什么都没留下…
展开
-
java删除对象属性值中的空格和换行回车符
public static void objectTrimAndRemoveRN(Object obj) { if (obj == null) { return; } Field[] fields = obj.getClass().getDeclaredFields(); for (Field field :...原创 2019-12-02 18:00:38 · 970 阅读 · 0 评论 -
校验18位身份证
校验18位身份证public static final int[] powerFactor = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2}; public static boolean validateIdCard18(String cardNo) { boolean bTrue =...原创 2019-11-15 15:08:07 · 1825 阅读 · 0 评论 -
java获取随机长度字符串
java获取随机长度字符串public static String getRandomString(int length) { String val = ""; Random random = new Random(); for (int i = 0; i < length; i++) { String charOrN...原创 2019-11-04 17:02:10 · 518 阅读 · 0 评论 -
Date,DateTime,LocalDate,String之间的相互转化
Date,DateTime,LocalDate,String之间的相互转化/** * Date转DateTime * * @param date * @return */public static DateTime dateToDateTime(Date date) { return new DateTime(date.getTime());}/** * DateTi...原创 2019-11-04 14:24:16 · 1573 阅读 · 0 评论 -
检测数组
检测数组是否为空直接上代码import java.util.Arrays;import java.util.Iterator;import java.util.NoSuchElementException;public class NullSafeIterable implements Iterable {private Iterable<T> iterable;pri...原创 2019-11-04 10:09:48 · 153 阅读 · 0 评论