Package com.ethlo.time
Class LeapSecondException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.time.DateTimeException
com.ethlo.time.LeapSecondException
- All Implemented Interfaces:
Serializable
This exception is used to signal that there was a potentially valid leap-second in the parsed input.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
private final OffsetDateTime
private final int
-
Constructor Summary
ConstructorsConstructorDescriptionLeapSecondException
(OffsetDateTime nearestDateTime, int secondsInMinute, boolean isVerifiedValidLeapYearMonth) -
Method Summary
Modifier and TypeMethodDescriptionGet the nearest date-time that is a roll-over to the next minute, (and potentially lower granularity fields) and 0 seconds.int
The number of seconds, typically60
.boolean
Whether this is a date-time with a well-known leap-secondMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
secondsInMinute
private final int secondsInMinute -
isVerifiedValidLeapYearMonth
private final boolean isVerifiedValidLeapYearMonth -
nearestDateTime
-
-
Constructor Details
-
LeapSecondException
public LeapSecondException(OffsetDateTime nearestDateTime, int secondsInMinute, boolean isVerifiedValidLeapYearMonth)
-
-
Method Details
-
getSecondsInMinute
public int getSecondsInMinute()The number of seconds, typically60
.- Returns:
- The number of seconds in this parsed date-time
-
getNearestDateTime
Get the nearest date-time that is a roll-over to the next minute, (and potentially lower granularity fields) and 0 seconds.- Returns:
- The date-time
-
isVerifiedValidLeapYearMonth
public boolean isVerifiedValidLeapYearMonth()Whether this is a date-time with a well-known leap-second- Returns:
- True if known, otherwise false
-