/** * Sets the previously added window to have fixed savings. * <p> * Setting a window to have fixed savings simply means that a single daylight * savings amount applies throughout the window. The window could be small, * such as a single summer, or large, such as a multi-year daylight savings. * <p> * A window can either have fixed savings or rules but not both. * * @param fixedSavingAmountSecs the amount of saving to use for the whole window, not null * @return this, for chaining * @throws IllegalStateException if no window has yet been added * @throws IllegalStateException if the window already has rules */ public ZoneRulesBuilder setFixedSavingsToWindow(int fixedSavingAmountSecs) { if (windowList.isEmpty()) { throw new IllegalStateException("Must add a window before setting the fixed savings"); } TZWindow window = windowList.get(windowList.size() - 1); window.setFixedSavings(fixedSavingAmountSecs); return this; }
/** * Sets the previously added window to have fixed savings. * <p> * Setting a window to have fixed savings simply means that a single daylight * savings amount applies throughout the window. The window could be small, * such as a single summer, or large, such as a multi-year daylight savings. * <p> * A window can either have fixed savings or rules but not both. * * @param fixedSavingAmountSecs the amount of saving to use for the whole window, not null * @return this, for chaining * @throws IllegalStateException if no window has yet been added * @throws IllegalStateException if the window already has rules */ public ZoneRulesBuilder setFixedSavingsToWindow(int fixedSavingAmountSecs) { if (windowList.isEmpty()) { throw new IllegalStateException("Must add a window before setting the fixed savings"); } TZWindow window = windowList.get(windowList.size() - 1); window.setFixedSavings(fixedSavingAmountSecs); return this; }