AmbiguousTimeError constructor
AmbiguousTimeError(
- ZonedDateTime earlierMapping,
- ZonedDateTime laterMapping
Constructs an instance from the given information.
User code is unlikely to need to deliberately call this constructor except possibly for testing.
The two mappings must have the same local time and time zone.
- earlierMapping: The earlier possible mapping
- laterMapping: The later possible mapping
Implementation
AmbiguousTimeError(this.earlierMapping, this.laterMapping)
: message = 'Local time ${earlierMapping.localDateTime} is ambiguous in time zone ${earlierMapping.zone.id}' {
Preconditions.checkArgument(earlierMapping.zone == laterMapping.zone, 'laterMapping',
'Ambiguous possible values must use the same time zone');
Preconditions.checkArgument(earlierMapping.localDateTime == laterMapping.localDateTime, 'laterMapping',
'Ambiguous possible values must have the same local date/time');
}