Пример #1
0
 /**
  * Compares this transition to another based on the transition instant.
  *
  * <p>This compares the instants of each transition. The offsets are ignored, making this order
  * inconsistent with equals.
  *
  * @param transition the transition to compare to, not null
  * @return the comparator value, negative if less, positive if greater
  */
 public int compareTo(ZoneOffsetTransition transition) {
   return this.getInstant().compareTo(transition.getInstant());
 }
Пример #2
0
 /**
  * Reads the state from the stream.
  *
  * @param in the input stream, not null
  * @return the created object, not null
  * @throws IOException if an error occurs
  */
 static ZoneOffsetTransition readExternal(DataInput in) throws IOException {
   long epochSecond = Ser.readEpochSec(in);
   ZoneOffset before = Ser.readOffset(in);
   ZoneOffset after = Ser.readOffset(in);
   return ZoneOffsetTransition.of(OffsetDateTime.ofEpochSecond(epochSecond, before), after);
 }