公历 @author SeanDragon
| 6 | * @author SeanDragon |
| 7 | */ |
| 8 | public class Solar { |
| 9 | private int solarYear; |
| 10 | private int solarMonth; |
| 11 | private int solarDay; |
| 12 | |
| 13 | public Solar(int solarYear, int solarMonth, int solarDay) { |
| 14 | this.solarYear = solarYear; |
| 15 | this.solarMonth = solarMonth; |
| 16 | this.solarDay = solarDay; |
| 17 | } |
| 18 | |
| 19 | public int getSolarYear() { |
| 20 | return solarYear; |
| 21 | } |
| 22 | |
| 23 | public Solar setSolarYear(int solarYear) { |
| 24 | this.solarYear = solarYear; |
| 25 | return this; |
| 26 | } |
| 27 | |
| 28 | public int getSolarMonth() { |
| 29 | return solarMonth; |
| 30 | } |
| 31 | |
| 32 | public Solar setSolarMonth(int solarMonth) { |
| 33 | this.solarMonth = solarMonth; |
| 34 | return this; |
| 35 | } |
| 36 | |
| 37 | public int getSolarDay() { |
| 38 | return solarDay; |
| 39 | } |
| 40 | |
| 41 | public Solar setSolarDay(int solarDay) { |
| 42 | this.solarDay = solarDay; |
| 43 | return this; |
| 44 | } |
| 45 | |
| 46 | @Override |
| 47 | public String toString() { |
| 48 | return String.format("公历:%S年%S月%S日", solarYear, solarMonth, solarDay); |
| 49 | } |
| 50 | } |
nothing calls this directly
no outgoing calls
no test coverage detected