Package net.time4j.tz

Enum Class GapResolver

java.lang.Object
java.lang.Enum<GapResolver>
net.time4j.tz.GapResolver
All Implemented Interfaces:
Serializable, Comparable<GapResolver>, java.lang.constant.Constable

public enum GapResolver extends Enum<GapResolver>

Represents the component of a transition strategy how to handle gaps on the local timeline.

Since:
2.2
Author:
Meno Hochschild
See Also:
OverlapResolver, TransitionStrategy
  • Enum Constant Details

    • PUSH_FORWARD

      public static final GapResolver PUSH_FORWARD

      Default strategy which moves an invalid local time by the length of the gap into the future.

      Example for the switch to summer time in the timezone "Europe/Berlin": 2015-03-29T02:30+01:00 => 2015-03-29T03:30+02:00

    • NEXT_VALID_TIME

      public static final GapResolver NEXT_VALID_TIME

      Alternative strategy which moves an invalid local time forward to the first valid time after transition.

      Example for the switch to summer time in the timezone "Europe/Berlin": 2015-03-29T02:30+01:00 => 2015-03-29T03:00+02:00

    • ABORT

      public static final GapResolver ABORT

      Strict strategy which rejects an invalid local time by throwing an exception.

  • Method Details

    • values

      public static GapResolver[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static GapResolver valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • and

      public TransitionStrategy and(OverlapResolver overlapResolver)

      Yields a transition strategy as combination of given overlap resolver and this instance.

      Parameters:
      overlapResolver - strategy how to handle overlaps on the local timeline
      Returns:
      transition strategy for handling gaps and overlaps
      Since:
      2.2