@Override public PeriodAdjustment build() { return new PeriodAdjustment( period, additionConvention, adjustment); }
/** * Obtains an instance that can adjust a date by the specified period. * <p> * When adjusting a date, the specified period is added to the input date. * The business day adjustment will then be used to ensure the result is a valid business day. * * @param period the period to add to the input date * @param additionConvention the convention used to perform the addition * @param adjustment the business day adjustment to apply to the result of the addition * @return the period adjustment */ public static PeriodAdjustment of( Period period, PeriodAdditionConvention additionConvention, BusinessDayAdjustment adjustment) { return new PeriodAdjustment(period, additionConvention, adjustment); }
/** * Obtains an instance that can adjust a date by the specified period using the * last day of month convention. * <p> * When adjusting a date, the specified period is added to the input date. * The business day adjustment will then be used to ensure the result is a valid business day. * <p> * The period must consist only of months and/or years. * * @param period the period to add to the input date * @param adjustment the business day adjustment to apply to the result of the addition * @return the period adjustment */ public static PeriodAdjustment ofLastDay(Period period, BusinessDayAdjustment adjustment) { return new PeriodAdjustment(period, PeriodAdditionConventions.LAST_DAY, adjustment); }
/** * Obtains an instance that can adjust a date by the specified period using the * last business day of month convention. * <p> * When adjusting a date, the specified period is added to the input date. * The business day adjustment will then be used to ensure the result is a valid business day. * <p> * The period must consist only of months and/or years. * * @param period the period to add to the input date * @param adjustment the business day adjustment to apply to the result of the addition * @return the period adjustment */ public static PeriodAdjustment ofLastBusinessDay(Period period, BusinessDayAdjustment adjustment) { return new PeriodAdjustment(period, PeriodAdditionConventions.LAST_BUSINESS_DAY, adjustment); }