- 博客(9)
- 收藏
- 关注
原创 Java 对象的复制
/** * * @param dest 复制到该对象 * @param src 从该对象复制 */ public static void copyProperties(Object dest,Object src){ try{ ConvertUtils.register(new DateConverter(null),java.util.Date.class); ConvertUtils.regi...
2019-01-15 10:39:55
349
原创 Java 图片旋转指定角度
/*** * 图片旋转指定角度 * @param bufferedimage 图像 * @param degree 角度 * @return * @date */ public static BufferedImage rotateImage(BufferedImage bufferedimage, int degree) { int w = bufferedimage.getWidth...
2019-01-15 10:39:21
520
原创 Java 剪裁图片
/*** * 剪裁图片 * @param file 图片 * @param x 起点横坐标 * @param y 纵坐标 * @param w 长 * @param h 高 * @throws IOException * @date */ public static BufferedImage cutImage(MultipartFile file, int x, int y, int w...
2019-01-15 10:38:51
690
原创 Java 生成4位随机数
/** * 产生4位随机数(0000-9999) * @return 4位随机数 */ public static String getFourRandom(){ Random random = new Random(); String fourRandom = random.nextInt(10000) + “”; int randLength = fourRandom.length(); if...
2019-01-15 10:38:11
18273
1
原创 Java 手机号码/电话号码验证
/** * 手机号验证 * @return 验证通过返回true */ public static boolean checkMobile(String str) { Pattern p = null; Matcher m = null; boolean b = false; p = Pattern.compile("1[3,4,5,7,8,9][0-9]{9}KaTeX parse error:...
2019-01-15 10:37:36
1176
原创 Java 金额是否为数字
/** * * 功能描述: 判断金额是否为数字(且是2位有效数字) */ public static boolean isNumber(String str) { String regex = "^([0-9]+(.[0-9]{1,2})?)|(-[0-9]+(.[0-9]{1,2})?)$"; Pattern pattern = Pattern.compile(regex); ...
2019-01-15 10:36:39
571
原创 Java 判断是否为整数
/** * * 功能描述: 判断是否为整数 (速度最快) * * @param: * @return: * @auther: * @date: 2018/9/14 9:01 / public static boolean isInteger(String str) { Pattern pattern = Pattern.compile("1?[\d]$"); return pattern.matc...
2019-01-15 10:36:03
5250
3
原创 Java 时间工具类(计算距离现在多久、返回某个日期的前一天、 返回当月最后一天的日期、获取当前时间到凌晨还剩多少毫秒、获取当前时间前一个月第一天......)
package com.qycar.common.utils; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; /** 日期处理 / public class DateUtils { /* 时间格式(yyyy-MM-dd) / public static final St...
2019-01-15 10:34:14
1901
原创 eclipse取消窗口置顶
@eclipse 不知道怎么搞的,窗口变成了置顶状态,查了一下,找到了快捷的办法。ctrl+alt+esc组合键就可以
2019-01-15 10:29:06
3194
4
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人