@Override public ValueSchedule build() { return new ValueSchedule( initialValue, steps, stepSequence); }
/** * Obtains an instance from an initial value and a sequence of steps. * <p> * The sequence defines changes from one date to another date using a frequency. * For example, the value might change every year from 2011-06-01 to 2015-06-01. * * @param initialValue the initial value used for the first period * @param stepSequence the full definition of how the value changes over time * @return the value schedule */ public static ValueSchedule of(double initialValue, ValueStepSequence stepSequence) { return new ValueSchedule(initialValue, ImmutableList.of(), stepSequence); }
/** * Obtains an instance from a single value that does not change over time. * * @param value a single value that does not change over time * @return the value schedule */ public static ValueSchedule of(double value) { return new ValueSchedule(value, ImmutableList.of(), null); }
/** * Obtains an instance from an initial value and a list of changes. * <p> * Each step fully defines a single change in the value. * The date of each change can be specified as an absolute date or in relative terms. * * @param initialValue the initial value used for the first period * @param steps the full definition of how the value changes over time * @return the value schedule */ public static ValueSchedule of(double initialValue, ValueStep... steps) { return new ValueSchedule(initialValue, ImmutableList.copyOf(steps), null); }
/** * Obtains an instance from an initial value and a list of changes. * <p> * Each step fully defines a single change in the value. * The date of each change can be specified as an absolute date or in relative terms. * * @param initialValue the initial value used for the first period * @param steps the full definition of how the value changes over time * @return the value schedule */ public static ValueSchedule of(double initialValue, List<ValueStep> steps) { return new ValueSchedule(initialValue, ImmutableList.copyOf(steps), null); }