class CsvLoaderUtils {

  static Optional<BusinessDayAdjustment> parseBusinessDayAdjustment(
      CsvRow row,
      String conventionField,
      String calendarField) {

    Optional<String> cnvOpt = row.findValue(conventionField);
    if (cnvOpt.isPresent()) {
      BusinessDayConvention cnv = LoaderUtils.parseBusinessDayConvention(cnvOpt.get());
      if (cnv.equals(BusinessDayConventions.NO_ADJUST)) {
        return Optional.of(BusinessDayAdjustment.NONE);
      }
      Optional<String> calOpt = row.findValue(calendarField);
      if (calOpt.isPresent()) {
        HolidayCalendarId cal = HolidayCalendarId.of(calOpt.get());
        return Optional.of(BusinessDayAdjustment.of(cnv, cal));
      }
    }
    return Optional.empty();
  }

  private  CsvLoaderUtils();

}