class PeriodicSchedule implements ImmutableBean, Serializable {

  public static PeriodicSchedule of(
      LocalDate unadjustedStartDate,
      LocalDate unadjustedEndDate,
      Frequency frequency,
      BusinessDayAdjustment businessDayAdjustment,
      StubConvention stubConvention,
      boolean preferEndOfMonth) {

    ArgChecker.notNull(unadjustedStartDate, "unadjustedStartDate");
    ArgChecker.notNull(unadjustedEndDate, "unadjustedEndDate");
    ArgChecker.notNull(frequency, "frequency");
    ArgChecker.notNull(businessDayAdjustment, "businessDayAdjustment");
    ArgChecker.notNull(stubConvention, "stubConvention");
    return PeriodicSchedule.builder()
        .startDate(unadjustedStartDate)
        .endDate(unadjustedEndDate)
        .frequency(frequency)
        .businessDayAdjustment(businessDayAdjustment)
        .stubConvention(stubConvention)
        .rollConvention(preferEndOfMonth ? RollConventions.EOM : null)
        .build();
  }

  private  PeriodicSchedule(
      LocalDate startDate,
      LocalDate endDate,
      Frequency frequency,
      BusinessDayAdjustment businessDayAdjustment,
      BusinessDayAdjustment startDateBusinessDayAdjustment,
      BusinessDayAdjustment endDateBusinessDayAdjustment,
      StubConvention stubConvention,
      RollConvention rollConvention,
      LocalDate firstRegularStartDate,
      LocalDate lastRegularEndDate,
      AdjustableDate overrideStartDate);

}