public Interval withDurationBeforeEnd ( ReadableDuration duration ) { long durationMillis = DateTimeUtils . getDurationMillis ( duration ) ; if ( durationMillis == toDurationMillis ( ) ) { return this ; } Chronology chrono = getChronology ( ) ; long endMillis = getEndMillis ( ) ; long startMillis = chrono . add ( endMillis , durationMillis , - 1 ) ; return new Interval ( startMillis , endMillis , chrono ) ; }
Creates a new interval with the specified duration before the end instant .