Package migratedb.core.internal.util
Enum DateTimeUtils
- java.lang.Object
-
- java.lang.Enum<DateTimeUtils>
-
- migratedb.core.internal.util.DateTimeUtils
-
- All Implemented Interfaces:
Serializable,Comparable<DateTimeUtils>
public enum DateTimeUtils extends Enum<DateTimeUtils>
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringformatDateAsIsoishString(Instant date)static StringformatDuration(long millis)Formats this execution time as minutes:seconds.millis.static DateTimeUtilsvalueOf(String name)Returns the enum constant of this type with the specified name.static DateTimeUtils[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Method Detail
-
values
public static DateTimeUtils[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DateTimeUtils c : DateTimeUtils.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DateTimeUtils valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
formatDateAsIsoishString
public static String formatDateAsIsoishString(Instant date)
- Parameters:
date- The date to format.- Returns:
- The date formatted as
yyyy-MM-dd HH:mm:ss. An empty string if the date is null.
-
formatDuration
public static String formatDuration(long millis)
Formats this execution time as minutes:seconds.millis. Ex.: 02:15.123s- Parameters:
millis- The number of millis.- Returns:
- The execution in a human-readable format.
-
-