mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add method
This commit is contained in:
parent
c663713680
commit
8614aecced
@ -20,6 +20,8 @@
|
||||
* 【core 】 Opt增加peeks方法(pr#445@Gitee)
|
||||
* 【extra 】 MailAccount中user默认值改为邮箱全称(issue#I4FYVY@Gitee)
|
||||
* 【core 】 增加CoordinateUtil(pr#446@Gitee)
|
||||
* 【core 】 DateUtil增加rangeToList重载(pr#1925@Github)
|
||||
* 【core 】 CollUtil增加safeContains方法(pr#1926@Github)
|
||||
|
||||
### 🐞Bug修复
|
||||
* 【core 】 修复UrlBuilder.addPath歧义问题(issue#1912@Github)
|
||||
|
@ -425,9 +425,11 @@ public class CollUtil {
|
||||
|
||||
/**
|
||||
* 判断指定集合是否包含指定值,如果集合为空(null或者空),返回{@code false},否则找到元素返回{@code true}
|
||||
*
|
||||
* @param collection 集合
|
||||
* @param value 需要查找的值
|
||||
* @return 果集合为空(null或者空),返回{@code false},否则找到元素返回{@code true}
|
||||
* @since 5.7.16
|
||||
*/
|
||||
public static boolean safeContains(Collection<?> collection, Object value) {
|
||||
|
||||
|
@ -1877,6 +1877,16 @@ public class DateUtil extends CalendarUtil {
|
||||
return CollUtil.newArrayList((Iterable<DateTime>) range(start, end, unit));
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建日期范围生成器
|
||||
*
|
||||
* @param start 起始日期时间
|
||||
* @param end 结束日期时间
|
||||
* @param unit 步进单位
|
||||
* @param step 步进
|
||||
* @return {@link DateRange}
|
||||
* @since 5.7.16
|
||||
*/
|
||||
public static List<DateTime> rangeToList(Date start, Date end, final DateField unit, int step) {
|
||||
return CollUtil.newArrayList((Iterable<DateTime>) new DateRange(start, end, unit, step));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user