sexagenary-cycle

a small library for 干支

License

License

GroupId

GroupId

com.github.jinahya
ArtifactId

ArtifactId

sexagenary-cycle
Last Version

Last Version

0.0.8
Release Date

Release Date

Type

Type

jar
Description

Description

sexagenary-cycle
a small library for 干支
Project URL

Project URL

https://github.com/jinahya/sexagenary-cycle
Project Organization

Project Organization

Jinahya, Inc.
Source Code Management

Source Code Management

https://github.com/jinahya/sexagenary-cycle

Download sexagenary-cycle

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.jinahya/sexagenary-cycle/ -->
<dependency>
    <groupId>com.github.jinahya</groupId>
    <artifactId>sexagenary-cycle</artifactId>
    <version>0.0.8</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.jinahya/sexagenary-cycle/
implementation 'com.github.jinahya:sexagenary-cycle:0.0.8'
// https://jarcasting.com/artifacts/com.github.jinahya/sexagenary-cycle/
implementation ("com.github.jinahya:sexagenary-cycle:0.0.8")
'com.github.jinahya:sexagenary-cycle:jar:0.0.8'
<dependency org="com.github.jinahya" name="sexagenary-cycle" rev="0.0.8">
  <artifact name="sexagenary-cycle" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.jinahya', module='sexagenary-cycle', version='0.0.8')
)
libraryDependencies += "com.github.jinahya" % "sexagenary-cycle" % "0.0.8"
[com.github.jinahya/sexagenary-cycle "0.0.8"]

Dependencies

provided (1)

Group / Artifact Type Version
jakarta.validation : jakarta.validation-api jar 2.0.2

test (7)

Group / Artifact Type Version
ch.qos.logback : logback-classic jar 1.2.3
org.assertj : assertj-core jar 3.18.1
org.junit.jupiter : junit-jupiter-api jar 5.7.0
org.junit.jupiter : junit-jupiter-engine jar 5.7.0
org.junit.jupiter : junit-jupiter-params jar 5.7.0
org.mockito : mockito-core jar 3.6.28
org.projectlombok : lombok jar 1.18.16

Project Modules

There are no modules declared in this project.

sexagenary-cycle

Java CI with Maven Quality Gate Status Maven Central javadoc

A small library for Sexagenary cycle depends on 0 external libraries.

Note that this library is not for converting dates between the lunar calendar and the sonar calendar. Please check 음양력변환계산 (한국천문연구원/천문우주시직정보) and/or 음양력 정보 (공공데이터포탈).

See also datagokr-api-b090041-lrsrcldinfoservice-client-spring .

천간(天干, Heavenly Stems)

final 天干 甲=天干.valueOf("");
assertThat(甲.getPrevious()).isSameAs(天干.ofName(""));
final 天干 乙=天干.ofName("");
assertThat(乙.getNext()).isSameAs(天干.ofName(""));
assertThat(乙.getPrevious()).isSameAs(甲);

지지(地支, Earthly Branches)

final 地支 子 = 地支.valueOfName("");
assertThat(子.getPrevious()).isSameAs(地支.valueOfName(""));
final 地支 丑 = 地支.valueOf("");
assertThat(丑.getNext()).isSameAs(地支.valueOf(""));
assertThat(丑.getPrevious()).isSameAs(子);

간지(干支, Sexagenary cycle)

final 干支 甲子 = 干支.valueOfName("甲子");
assertThat(甲子.getName()).isEqualTo("甲子");
assertThat(甲子).isSameAs(干支.valueOf(天干.valueOfName(""), 地支.valueOfName("")));
assertThat(甲子.getPrevious()).isSameAs(干支.valueOfName("癸亥"));
assertThat(甲子.getNext()).isSameAs(干支.valueOfName("乙丑"));

세차(歲次) / 월건(月建) / 일진(日辰)

// (陰曆) 2020
final 歲次 庚子年=new 歲次(干支.valueOfName("庚子"),Year.of(2020));
assertThat(庚子年..getValue()).isEqualTo(2020);
assertThat(庚子年.getPrevious()).isEqualTo(new 歲次(干支.valueOfName("庚子").getPrevious(),Year.of(2019)));
assertThat(庚子年.getNext()).isEqualTo(new 歲次(干支.valueOfName("庚子").getNext(),Year.of(2021)));
// (陰曆) 2020-12
final 月建 戊子月=new 月建(干支.valueOfName("戊子"),Month.DECEMBER,庚子年);
assertThat(戊子月.月).isSameAs(Month.DECEMBER);
assertThat(戊子月.is閏月()).isFalse();
// (陰曆) 2020-12-23 / (陽曆) 2021-02-04.
final 日辰 庚子日=new 日辰(干支.valueOfName("庚子"),23,戊子月);
assertThat(庚子日.日).isEqualTo(23);
// Two APRIL(4月)s in 2020
{
    // (陰曆) 2020-04; the 1st APRIL of 2020
    final 月建 辛巳月=new 月建(干支.valueOfName("辛巳"),Month.APRIL,庚子年);
    assertThat(辛巳月.is閏月()).isFalse();
    // (陰曆) 2020-04-01 / (陽曆) 2020-04-23
    final 日辰 丙申日=new 日辰(干支.valueOfName("丙申"),23,辛巳月);
    assertThat(丙申日.日).isEqualTo(23);
}
{
    // (陰曆) 2020-04; the 2nd APRIL of 2020
    final 月建 閏四月=月建.newInstanceOf閏月(Month.APRIL,庚子年);
    assertThat(閏四月.is閏月()).isTrue();
    // (陰曆) 2020-04-01 / (陽曆) 2020-05-23.
    final 日辰 丙寅日=new 日辰(干支.valueOfName("丙寅"),1,閏四月);
    assertThat(丙寅日.日).isEqualTo(1);
}

Versions

Version
0.0.8
0.0.7
0.0.6
0.0.5
0.0.3