MCPcopy Create free account
hub / github.com/SeanDragon/protools / Lunar

Class Lunar

common/src/main/java/pro/tools/time/Lunar.java:8–60  ·  view source on GitHub ↗

农历 @author SeanDragon

Source from the content-addressed store, hash-verified

6 * @author SeanDragon
7 */
8public class Lunar {
9 private boolean isLeap;
10 private int lunarYear;
11 private int lunarMonth;
12 private int lunarDay;
13
14 public Lunar(int lunarYear, int lunarMonth, int lunarDay) {
15 this.lunarDay = lunarDay;
16 this.lunarMonth = lunarMonth;
17 this.lunarYear = lunarYear;
18 }
19
20 public boolean getIsLeap() {
21 return isLeap;
22 }
23
24 public Lunar setIsLeap(boolean leap) {
25 isLeap = leap;
26 return this;
27 }
28
29 public int getLunarYear() {
30 return lunarYear;
31 }
32
33 public Lunar setLunarYear(int lunarYear) {
34 this.lunarYear = lunarYear;
35 return this;
36 }
37
38 public int getLunarMonth() {
39 return lunarMonth;
40 }
41
42 public Lunar setLunarMonth(int lunarMonth) {
43 this.lunarMonth = lunarMonth;
44 return this;
45 }
46
47 public int getLunarDay() {
48 return lunarDay;
49 }
50
51 public Lunar setLunarDay(int lunarDay) {
52 this.lunarDay = lunarDay;
53 return this;
54 }
55
56 @Override
57 public String toString() {
58 return String.format("阴历:%S年%S月%S日", lunarYear, lunarMonth, lunarDay) + (isLeap ? "(闰年)" : "");
59 }
60}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected