コード例 #1
0
ファイル: LogFiles.java プロジェクト: czohshima/digdag
 public static String formatSessoinPrefix(LogFilePrefix prefix) {
   return String.format(
       ENGLISH,
       "%d.%d%s@%s",
       prefix.getSiteId(),
       prefix.getProjectId(),
       prefix.getWorkflowName(),
       SESSION_TIME_FORMATTER.withZone(prefix.getTimeZone()).format(prefix.getSessionTime()));
 }
コード例 #2
0
  public static DateTimeFormatter getDateTimeFormatter(ColumnDefinition<?, ?> columnDefinition) {
    DateTimeFormatter dtf;

    if (columnDefinition.has(JavaDateTimeFormatterProperty.class)) {
      dtf = columnDefinition.lookFor(JavaDateTimeFormatterProperty.class).getFormatter();
    } else if (columnDefinition.has(DateFormatProperty.class)) {
      dtf =
          DateTimeFormatter.ofPattern(
              columnDefinition.lookFor(DateFormatProperty.class).getPattern());
    } else {
      throw new IllegalArgumentException("No date format pattern specified");
    }

    final ZoneId zoneId = _getZoneId(columnDefinition);

    if (zoneId != null) {
      dtf = dtf.withZone(zoneId);
    } else if (dtf.getZone() == null) {
      dtf = dtf.withZone(ZoneId.systemDefault());
    }

    return dtf;
  }