net.time4j.tz.GapResolver Maven / Gradle / Ivy
/*
* -----------------------------------------------------------------------
* Copyright © 2013-2015 Meno Hochschild,
* -----------------------------------------------------------------------
* This file (GapResolver.java) is part of project Time4J.
*
* Time4J is free software: You can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 2.1 of the License, or
* (at your option) any later version.
*
* Time4J is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Time4J. If not, see .
* -----------------------------------------------------------------------
*/
package net.time4j.tz;
/**
* Represents the component of a transition strategy how to handle gaps
* on the local timeline.
*
* @author Meno Hochschild
* @since 2.2
* @see OverlapResolver
* @see TransitionStrategy
*/
/*[deutsch]
* Repräsentiert die Komponente einer Übergangsstrategie, wie
* Lücken auf dem lokalen Zeitstrahl behandelt werden.
*
* @author Meno Hochschild
* @since 2.2
* @see OverlapResolver
* @see TransitionStrategy
*/
public enum GapResolver {
//~ Statische Felder/Initialisierungen --------------------------------
/**
* 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":
* {@code 2015-03-29T02:30+01:00 => 2015-03-29T03:30+02:00}
*/
/*[deutsch]
* Standardstrategie, die eine ungültige lokale Zeit um die
* Länge der Lücke in die Zukunft verschiebt.
*
* Beispiel für die Umschaltung auf Sommerzeit in der Zeitzone
* "Europe/Berlin":
* {@code 2015-03-29T02:30+01:00 => 2015-03-29T03:30+02:00}
*/
PUSH_FORWARD,
/**
* 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":
* {@code 2015-03-29T02:30+01:00 => 2015-03-29T03:00+02:00}
*/
/*[deutsch]
* Alternative Strategie, die eine ungültige lokale Zeit auf die
* erste gültige lokale Zeit nach dem Übergang setzt.
*
* Beispiel für die Umschaltung auf Sommerzeit in der Zeitzone
* "Europe/Berlin":
* {@code 2015-03-29T02:30+01:00 => 2015-03-29T03:00+02:00}
*/
NEXT_VALID_TIME,
/**
* Strict strategy which rejects an invalid local time by throwing
* an exception.
*/
/*[deutsch]
* Strikte Strategie, die eine ungültige lokale Zeit mit einer
* Ausnahme verwirft.
*/
ABORT;
//~ Methoden ----------------------------------------------------------
/**
* Yields a transition strategy as combination of given overlap resolver
* and this instance.
*
* @param overlapResolver strategy how to handle overlaps on the
* local timeline
* @return transition strategy for handling gaps and overlaps
* @since 2.2
*/
/*[deutsch]
* Liefert eine Übergangsstrategie als Kombination der angegebenen
* Überlappungsstrategie und dieser Instanz.
*
* @param overlapResolver strategy how to handle overlaps on the
* local timeline
* @return transition strategy for handling gaps and overlaps
* @since 2.2
*/
public TransitionStrategy and(OverlapResolver overlapResolver) {
return TransitionResolver.of(this, overlapResolver);
}
}