add static fromXX methods
This commit is contained in:
@@ -39,7 +39,7 @@ public class SolarYear{
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过年
|
||||
* 通过年初始化
|
||||
*
|
||||
* @param year 年
|
||||
*/
|
||||
@@ -47,6 +47,36 @@ public class SolarYear{
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过指定日期获取阳历年
|
||||
*
|
||||
* @param date 日期
|
||||
* @return 阳历年
|
||||
*/
|
||||
public static SolarYear fromDate(Date date){
|
||||
return new SolarYear(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过指定日历获取阳历年
|
||||
*
|
||||
* @param calendar 日历
|
||||
* @return 阳历年
|
||||
*/
|
||||
public static SolarYear fromCalendar(Calendar calendar){
|
||||
return new SolarYear(calendar);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过指定年份获取阳历年
|
||||
*
|
||||
* @param year 年
|
||||
* @return 阳历年
|
||||
*/
|
||||
public static SolarYear fromYear(int year){
|
||||
return new SolarYear(year);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取年
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user