8 private final LocalDatetime localDateTime;
10 public NDateTime(LocalDatetime localDateTime) {
11 this.localDateTime = localDateTime;
18 return localDateTime.getYear();
25 return localDateTime.getMonth();
32 return localDateTime.getDay();
39 return localDateTime.getHour();
46 return localDateTime.getMinute();
53 return localDateTime.getSec();
60 return localDateTime.getMicrosec();
64 public String toString() {
65 return String.format(
"%d-%02d-%02dT%02d:%02d:%02d.%06d",
66 localDateTime.getYear(), localDateTime.getMonth(), localDateTime.getDay(),
67 localDateTime.getHour(), localDateTime.getMinute(), localDateTime.getSec(),
68 localDateTime.getMicrosec());
72 public boolean equals(Object o) {
76 if (o ==
null || getClass() != o.getClass()) {
79 NDateTime that = (NDateTime) o;
80 return localDateTime.getYear() == that.getYear()
81 && localDateTime.getMonth() == that.getMonth()
82 && localDateTime.getDay() == that.getDay()
83 && localDateTime.getHour() == that.getHour()
84 && localDateTime.getMinute() == that.getMinute()
85 && localDateTime.getSec() == that.getSecond()
86 && localDateTime.getMicrosec() == that.getMicrosec();
90 public int hashCode() {
91 return Objects.hash(localDateTime);