mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
update junit
This commit is contained in:
parent
8ae81241be
commit
5d60656566
@ -80,7 +80,7 @@ public class DateTime extends Date {
|
|||||||
*
|
*
|
||||||
* @param dateStr Date字符串
|
* @param dateStr Date字符串
|
||||||
* @param format 格式
|
* @param format 格式
|
||||||
* @return {@link DateTime}
|
* @return this
|
||||||
* @see DatePattern
|
* @see DatePattern
|
||||||
*/
|
*/
|
||||||
public static DateTime of(String dateStr, String format) {
|
public static DateTime of(String dateStr, String format) {
|
||||||
@ -161,8 +161,8 @@ public class DateTime extends Date {
|
|||||||
/**
|
/**
|
||||||
* 给定日期Instant的构造
|
* 给定日期Instant的构造
|
||||||
*
|
*
|
||||||
* @param instant {@link Instant} 对象
|
* @param instant {@link Instant} 对象
|
||||||
* @param zoneId 时区ID
|
* @param zoneId 时区ID
|
||||||
* @since 5.0.5
|
* @since 5.0.5
|
||||||
*/
|
*/
|
||||||
public DateTime(Instant instant, ZoneId zoneId) {
|
public DateTime(Instant instant, ZoneId zoneId) {
|
||||||
@ -268,7 +268,7 @@ public class DateTime extends Date {
|
|||||||
* @return 如果此对象为可变对象,返回自身,否则返回新对象
|
* @return 如果此对象为可变对象,返回自身,否则返回新对象
|
||||||
*/
|
*/
|
||||||
public DateTime offset(DateField datePart, int offset) {
|
public DateTime offset(DateField datePart, int offset) {
|
||||||
if(DateField.ERA == datePart){
|
if (DateField.ERA == datePart) {
|
||||||
throw new IllegalArgumentException("ERA is not support offset!");
|
throw new IllegalArgumentException("ERA is not support offset!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -282,7 +282,7 @@ public class DateTime extends Date {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 调整日期和时间<br>
|
* 调整日期和时间<br>
|
||||||
* 返回调整后的新{@link DateTime},不影响原对象
|
* 返回调整后的新DateTime,不影响原对象
|
||||||
*
|
*
|
||||||
* @param datePart 调整的部分 {@link DateField}
|
* @param datePart 调整的部分 {@link DateField}
|
||||||
* @param offset 偏移量,正数为向后偏移,负数为向前偏移
|
* @param offset 偏移量,正数为向后偏移,负数为向前偏移
|
||||||
@ -329,7 +329,7 @@ public class DateTime extends Date {
|
|||||||
*
|
*
|
||||||
* @param field 表示日期的哪个部分的枚举 {@link DateField}
|
* @param field 表示日期的哪个部分的枚举 {@link DateField}
|
||||||
* @param value 值
|
* @param value 值
|
||||||
* @return {@link DateTime}
|
* @return this
|
||||||
*/
|
*/
|
||||||
public DateTime setField(DateField field, int value) {
|
public DateTime setField(DateField field, int value) {
|
||||||
return setField(field.getValue(), value);
|
return setField(field.getValue(), value);
|
||||||
@ -341,7 +341,7 @@ public class DateTime extends Date {
|
|||||||
*
|
*
|
||||||
* @param field 表示日期的哪个部分的int值 {@link Calendar}
|
* @param field 表示日期的哪个部分的int值 {@link Calendar}
|
||||||
* @param value 值
|
* @param value 值
|
||||||
* @return {@link DateTime}
|
* @return this
|
||||||
*/
|
*/
|
||||||
public DateTime setField(int field, int value) {
|
public DateTime setField(int field, int value) {
|
||||||
final Calendar calendar = toCalendar();
|
final Calendar calendar = toCalendar();
|
||||||
@ -401,10 +401,11 @@ public class DateTime extends Date {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取月,从1开始计数
|
* 获取月,从1开始计数
|
||||||
|
*
|
||||||
* @return 月份,1表示一月
|
* @return 月份,1表示一月
|
||||||
* @since 5.4.1
|
* @since 5.4.1
|
||||||
*/
|
*/
|
||||||
public int monthBaseOne(){
|
public int monthBaseOne() {
|
||||||
return month() + 1;
|
return month() + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -834,7 +835,7 @@ public class DateTime extends Date {
|
|||||||
* @return 时区
|
* @return 时区
|
||||||
* @since 5.0.5
|
* @since 5.0.5
|
||||||
*/
|
*/
|
||||||
public TimeZone getTimeZone(){
|
public TimeZone getTimeZone() {
|
||||||
return this.timeZone;
|
return this.timeZone;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -844,7 +845,7 @@ public class DateTime extends Date {
|
|||||||
* @return 时区ID
|
* @return 时区ID
|
||||||
* @since 5.0.5
|
* @since 5.0.5
|
||||||
*/
|
*/
|
||||||
public ZoneId getZoneId(){
|
public ZoneId getZoneId() {
|
||||||
return this.timeZone.toZoneId();
|
return this.timeZone.toZoneId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
pom.xml
2
pom.xml
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
<!-- versions -->
|
<!-- versions -->
|
||||||
<compile.version>8</compile.version>
|
<compile.version>8</compile.version>
|
||||||
<junit.version>4.13</junit.version>
|
<junit.version>4.13.1</junit.version>
|
||||||
<lombok.version>1.18.12</lombok.version>
|
<lombok.version>1.18.12</lombok.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user