# RedenUtil **Repository Path**: delamer/reden-util ## Basic Information - **Project Name**: RedenUtil - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-25 - **Last Updated**: 2022-07-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # RedenUtil工具包 ### 日期工具 DateUtil 静态工具,提供了以下方法: - getDate 返回日期(年-月-日) - getTime 返回时间(时:分:秒) - getDateTime 返回日期+时间(年-月-日 时:分:秒) - getYear 返回年 - getMonth 返回月 - getDay 返回日 - getHour 返回时 - getMinute 返回分 - getSecond 返回秒 - getMillis 返回毫秒 - getTimeStamp 返回时间戳(秒) - getDateByString 将日期字符串转换为Date对象 默认日期格式`yyyy-MM-dd HH:mm:ss`,可自行传入其他格式以控制出参 未做异常处理 ### 校验工具 ValidateUtil 静态工具,提供了以下方法: - isNull 校验空值(null) - isEmpty 校验空量(长度为0) - isBlank 校验空串(字符串除空格外无内容) - isInteger 校验整数 - isDecimal 校验小数 - isNumber 校验数字 - isEmail 校验邮箱 - isMobile 校验手机号 - isIdentity 校验身份证号 除以上方法外还有每个方法对应的'非'逻辑校验 未做异常处理 ### 文字工具 StringUtil 静态工具,提供了以下方法: - matches 校验字符串与正则是否完全匹配 - contain 校验字符串是否包含与该正则匹配的字符串 - extract 提取出字符串中符合正则的字符串 - kernel 提取出字符串中镶嵌在对应正则中的字符串 工具未做判空处理,请自行确保传入数据不为空 已做异常处理 ### 文件工具 FileUtil 静态工具,提供了以下方法: - pack 将对应路径下的文件压缩成压缩包并写入到指定位置 - read 读取对应文件的内容 - write 将内容写入指定文件 - rewrite 将内容覆写到指定文件 已做异常处理