Package biz.onixs.util
Enum TimestampFormat
- java.lang.Object
-
- java.lang.Enum<TimestampFormat>
-
- biz.onixs.util.TimestampFormat
-
- All Implemented Interfaces:
Serializable,Comparable<TimestampFormat>
public enum TimestampFormat extends Enum<TimestampFormat>
Represents different timestamp formats.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description YYYYMMDDIndicates timestamp in "YYYYMMDD" format.YYYYMMDDHHMMSSIndicates timestamp in "YYYYMMDD-HH:MM:SS" format.YYYYMMDDHHMMSSMsecIndicates timestamp in "YYYYMMDD-HH:MM:SS.sss" format.YYYYMMDDHHMMSSNsecIndicates timestamp in "YYYYMMDD-HH:MM:SS.sssssssss" format.YYYYMMDDHHMMSSPsecIndicates timestamp in "YYYYMMDD-HH:MM:SS.ssssssssssss" format.YYYYMMDDHHMMSSUsecIndicates timestamp in "YYYYMMDD-HH:MM:SS.ssssss" format.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TimestampFormatgetByLengthOrNull(int length)Retrieves the timestamp format based on its length.intgetLength()Returns the length of the timestamp format.static TimestampFormatvalueOf(String name)Returns the enum constant of this type with the specified name.static TimestampFormat[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
YYYYMMDD
public static final TimestampFormat YYYYMMDD
Indicates timestamp in "YYYYMMDD" format.
-
YYYYMMDDHHMMSS
public static final TimestampFormat YYYYMMDDHHMMSS
Indicates timestamp in "YYYYMMDD-HH:MM:SS" format.
-
YYYYMMDDHHMMSSMsec
public static final TimestampFormat YYYYMMDDHHMMSSMsec
Indicates timestamp in "YYYYMMDD-HH:MM:SS.sss" format.
-
YYYYMMDDHHMMSSUsec
public static final TimestampFormat YYYYMMDDHHMMSSUsec
Indicates timestamp in "YYYYMMDD-HH:MM:SS.ssssss" format.
-
YYYYMMDDHHMMSSNsec
public static final TimestampFormat YYYYMMDDHHMMSSNsec
Indicates timestamp in "YYYYMMDD-HH:MM:SS.sssssssss" format.
-
YYYYMMDDHHMMSSPsec
public static final TimestampFormat YYYYMMDDHHMMSSPsec
Indicates timestamp in "YYYYMMDD-HH:MM:SS.ssssssssssss" format.
-
-
Method Detail
-
values
public static TimestampFormat[] 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 (TimestampFormat c : TimestampFormat.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TimestampFormat 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
-
getLength
public int getLength()
Returns the length of the timestamp format.- Returns:
- The length of the timestamp format.
-
getByLengthOrNull
public static TimestampFormat getByLengthOrNull(int length)
Retrieves the timestamp format based on its length.- Parameters:
length- The length of the timestamp format.- Returns:
- The corresponding
TimestampFormatif found, otherwisenull.
-
-