/** * Checks if the exception is, or has a cause, of {@code IllegalInstantException}. * * @param ex the exception to check * @return true if an {@code IllegalInstantException} */ public static boolean isIllegalInstant(Throwable ex) { if (ex instanceof IllegalInstantException) { return true; } while (ex.getCause() != null && ex.getCause() != ex) { return isIllegalInstant(ex.getCause()); } return false; }
/** * Checks if the exception is, or has a cause, of {@code IllegalInstantException}. * * @param ex the exception to check * @return true if an {@code IllegalInstantException} */ public static boolean isIllegalInstant(Throwable ex) { if (ex instanceof IllegalInstantException) { return true; } while (ex.getCause() != null && ex.getCause() != ex) { return isIllegalInstant(ex.getCause()); } return false; }
/** * Returns a new DateTime with this field set to the minimum value * for this field. * <p> * Where possible, the offset from UTC will be retained, thus applications * may need to call {@link DateTime#withEarlierOffsetAtOverlap()} on the result * to force the earlier time during a DST overlap if desired. * <p> * From v2.2, this method handles a daylight savings time gap, setting the * time to the first instant after the gap. * <p> * The DateTime attached to this property is unchanged by this call. * * @return a copy of the DateTime with this field set to its minimum * @since 1.2 */ public DateTime withMinimumValue() { try { return setCopy(getMinimumValue()); } catch (RuntimeException ex) { if (IllegalInstantException.isIllegalInstant(ex)) { // subtracting MILLIS_PER_DAY is not perfect, but will work in almost all situations long afterGap = getChronology().getZone().nextTransition(getMillis() - DateTimeConstants.MILLIS_PER_DAY); return new DateTime(afterGap, getChronology()); } throw ex; } }
/** * Returns a new DateTime with this field set to the minimum value * for this field. * <p> * Where possible, the offset from UTC will be retained, thus applications * may need to call {@link DateTime#withEarlierOffsetAtOverlap()} on the result * to force the earlier time during a DST overlap if desired. * <p> * From v2.2, this method handles a daylight savings time gap, setting the * time to the first instant after the gap. * <p> * The DateTime attached to this property is unchanged by this call. * * @return a copy of the DateTime with this field set to its minimum * @since 1.2 */ public DateTime withMinimumValue() { try { return setCopy(getMinimumValue()); } catch (RuntimeException ex) { if (IllegalInstantException.isIllegalInstant(ex)) { // subtracting MILLIS_PER_DAY is not perfect, but will work in almost all situations long afterGap = getChronology().getZone().nextTransition(getMillis() - DateTimeConstants.MILLIS_PER_DAY); return new DateTime(afterGap, getChronology()); } throw ex; } }
return setCopy(getMaximumValue()); } catch (RuntimeException ex) { if (IllegalInstantException.isIllegalInstant(ex)) {
return setCopy(getMaximumValue()); } catch (RuntimeException ex) { if (IllegalInstantException.isIllegalInstant(ex)) {
/** * Checks if the exception is, or has a cause, of {@code IllegalInstantException}. * * @param ex the exception to check * @return true if an {@code IllegalInstantException} */ public static boolean isIllegalInstant(Throwable ex) { if (ex instanceof IllegalInstantException) { return true; } while (ex.getCause() != null && ex.getCause() != ex) { return isIllegalInstant(ex.getCause()); } return false; }
/** * Checks if the exception is, or has a cause, of {@code IllegalInstantException}. * * @param ex the exception to check * @return true if an {@code IllegalInstantException} */ public static boolean isIllegalInstant(Throwable ex) { if (ex instanceof IllegalInstantException) { return true; } while (ex.getCause() != null && ex.getCause() != ex) { return isIllegalInstant(ex.getCause()); } return false; }
/** * Checks if the exception is, or has a cause, of {@code IllegalInstantException}. * * @param ex the exception to check * @return true if an {@code IllegalInstantException} */ public static boolean isIllegalInstant(Throwable ex) { if (ex instanceof IllegalInstantException) { return true; } while (ex.getCause() != null && ex.getCause() != ex) { return isIllegalInstant(ex.getCause()); } return false; }
/** * Checks if the exception is, or has a cause, of {@code IllegalInstantException}. * * @param ex the exception to check * @return true if an {@code IllegalInstantException} */ public static boolean isIllegalInstant(Throwable ex) { if (ex instanceof IllegalInstantException) { return true; } while (ex.getCause() != null && ex.getCause() != ex) { return isIllegalInstant(ex.getCause()); } return false; }
/** * Checks if the exception is, or has a cause, of {@code IllegalInstantException}. * * @param ex the exception to check * @return true if an {@code IllegalInstantException} */ public static boolean isIllegalInstant(Throwable ex) { if (ex instanceof IllegalInstantException) { return true; } while (ex.getCause() != null && ex.getCause() != ex) { return isIllegalInstant(ex.getCause()); } return false; }
/** * Checks if the exception is, or has a cause, of {@code IllegalInstantException}. * * @param ex the exception to check * @return true if an {@code IllegalInstantException} */ public static boolean isIllegalInstant(Throwable ex) { if (ex instanceof IllegalInstantException) { return true; } while (ex.getCause() != null && ex.getCause() != ex) { return isIllegalInstant(ex.getCause()); } return false; }
/** * Returns a new DateTime with this field set to the minimum value * for this field. * <p> * Where possible, the offset from UTC will be retained, thus applications * may need to call {@link DateTime#withEarlierOffsetAtOverlap()} on the result * to force the earlier time during a DST overlap if desired. * <p> * From v2.2, this method handles a daylight svaings time gap, setting the * time to the first instant after the gap. * <p> * The DateTime attached to this property is unchanged by this call. * * @return a copy of the DateTime with this field set to its minimum * @since 1.2 */ public DateTime withMinimumValue() { try { return setCopy(getMinimumValue()); } catch (RuntimeException ex) { if (IllegalInstantException.isIllegalInstant(ex)) { // subtracting MILLIS_PER_DAY is not perfect, but will work in almost all situations long afterGap = getChronology().getZone().nextTransition(getMillis() - DateTimeConstants.MILLIS_PER_DAY); return new DateTime(afterGap, getChronology()); } throw ex; } }
/** * Returns a new DateTime with this field set to the minimum value * for this field. * <p> * Where possible, the offset from UTC will be retained, thus applications * may need to call {@link DateTime#withEarlierOffsetAtOverlap()} on the result * to force the earlier time during a DST overlap if desired. * <p> * From v2.2, this method handles a daylight svaings time gap, setting the * time to the first instant after the gap. * <p> * The DateTime attached to this property is unchanged by this call. * * @return a copy of the DateTime with this field set to its minimum * @since 1.2 */ public DateTime withMinimumValue() { try { return setCopy(getMinimumValue()); } catch (RuntimeException ex) { if (IllegalInstantException.isIllegalInstant(ex)) { // subtracting MILLIS_PER_DAY is not perfect, but will work in almost all situations long afterGap = getChronology().getZone().nextTransition(getMillis() - DateTimeConstants.MILLIS_PER_DAY); return new DateTime(afterGap, getChronology()); } throw ex; } }
/** * Returns a new DateTime with this field set to the minimum value * for this field. * <p> * Where possible, the offset from UTC will be retained, thus applications * may need to call {@link DateTime#withEarlierOffsetAtOverlap()} on the result * to force the earlier time during a DST overlap if desired. * <p> * From v2.2, this method handles a daylight svaings time gap, setting the * time to the first instant after the gap. * <p> * The DateTime attached to this property is unchanged by this call. * * @return a copy of the DateTime with this field set to its minimum * @since 1.2 */ public DateTime withMinimumValue() { try { return setCopy(getMinimumValue()); } catch (RuntimeException ex) { if (IllegalInstantException.isIllegalInstant(ex)) { // subtracting MILLIS_PER_DAY is not perfect, but will work in almost all situations long afterGap = getChronology().getZone().nextTransition(getMillis() - DateTimeConstants.MILLIS_PER_DAY); return new DateTime(afterGap, getChronology()); } throw ex; } }
/** * Returns a new DateTime with this field set to the minimum value * for this field. * <p> * Where possible, the offset from UTC will be retained, thus applications * may need to call {@link DateTime#withEarlierOffsetAtOverlap()} on the result * to force the earlier time during a DST overlap if desired. * <p> * From v2.2, this method handles a daylight svaings time gap, setting the * time to the first instant after the gap. * <p> * The DateTime attached to this property is unchanged by this call. * * @return a copy of the DateTime with this field set to its minimum * @since 1.2 */ public DateTime withMinimumValue() { try { return setCopy(getMinimumValue()); } catch (RuntimeException ex) { if (IllegalInstantException.isIllegalInstant(ex)) { // subtracting MILLIS_PER_DAY is not perfect, but will work in almost all situations long afterGap = getChronology().getZone().nextTransition(getMillis() - DateTimeConstants.MILLIS_PER_DAY); return new DateTime(afterGap, getChronology()); } throw ex; } }
/** * Returns a new DateTime with this field set to the minimum value * for this field. * <p> * Where possible, the offset from UTC will be retained, thus applications * may need to call {@link DateTime#withEarlierOffsetAtOverlap()} on the result * to force the earlier time during a DST overlap if desired. * <p> * From v2.2, this method handles a daylight svaings time gap, setting the * time to the first instant after the gap. * <p> * The DateTime attached to this property is unchanged by this call. * * @return a copy of the DateTime with this field set to its minimum * @since 1.2 */ public DateTime withMinimumValue() { try { return setCopy(getMinimumValue()); } catch (RuntimeException ex) { if (IllegalInstantException.isIllegalInstant(ex)) { // subtracting MILLIS_PER_DAY is not perfect, but will work in almost all situations long afterGap = getChronology().getZone().nextTransition(getMillis() - DateTimeConstants.MILLIS_PER_DAY); return new DateTime(afterGap, getChronology()); } throw ex; } }
/** * Returns a new DateTime with this field set to the minimum value * for this field. * <p> * Where possible, the offset from UTC will be retained, thus applications * may need to call {@link DateTime#withEarlierOffsetAtOverlap()} on the result * to force the earlier time during a DST overlap if desired. * <p> * From v2.2, this method handles a daylight savings time gap, setting the * time to the first instant after the gap. * <p> * The DateTime attached to this property is unchanged by this call. * * @return a copy of the DateTime with this field set to its minimum * @since 1.2 */ public DateTime withMinimumValue() { try { return setCopy(getMinimumValue()); } catch (RuntimeException ex) { if (IllegalInstantException.isIllegalInstant(ex)) { // subtracting MILLIS_PER_DAY is not perfect, but will work in almost all situations long afterGap = getChronology().getZone().nextTransition(getMillis() - DateTimeConstants.MILLIS_PER_DAY); return new DateTime(afterGap, getChronology()); } throw ex; } }
return setCopy(getMaximumValue()); } catch (RuntimeException ex) { if (IllegalInstantException.isIllegalInstant(ex)) {
return setCopy(getMaximumValue()); } catch (RuntimeException ex) { if (IllegalInstantException.isIllegalInstant(ex)) {