toFormatString method

String toFormatString(
  1. CronExpressionOutputFormat outputFormat
)

Implementation

String toFormatString(CronExpressionOutputFormat outputFormat) {
  return [
    second.toString(),
    minute.toString(),
    hour.toString(),
    dayOfMonth.toString(),
    month.toFormatString(outputFormat),
    dayOfWeek.toFormatString(outputFormat),
    year.toString(),
  ]
      .join(' ')
      .trim()
      .replaceFirst('?', type == CronExpressionType.STANDARD ? '*' : '?');
}