10 private final int hour;
11 private final int minute;
12 private final int second;
13 private final int microSec;
14 private final ZoneOffset timeZoneOffset;
16 public NZonedTime(
int hour,
int minute,
int second,
int microSec, ZoneOffset timeZoneOffset) {
20 this.microSec = microSec;
21 this.timeZoneOffset = timeZoneOffset;
24 public NZonedTime(LocalTime localTime, ZoneOffset timeZoneOffset) {
25 this.hour = localTime.
getHour();
26 this.minute = localTime.getMinute();
27 this.second = localTime.getSecond();
28 this.microSec = localTime.getNano() / 1000;
29 this.timeZoneOffset = timeZoneOffset;
66 return timeZoneOffset.getTotalSeconds();
71 public String toString() {
72 return String.format(
"%02d:%02d:%02d.%06d%s",
81 public boolean equals(Object o) {
85 if (o ==
null || getClass() != o.getClass()) {
88 NZonedTime that = (NZonedTime) o;
89 return hour == that.getHour()
90 && minute == that.getMinute()
91 && second == that.getSecond()
92 && microSec == that.getMicrosec()
97 public int hashCode() {
98 return Objects.hash(hour, minute, second, microSec,
getOffset());