Package ome.xml.model.primitives
Class Timestamp
- java.lang.Object
-
- ome.xml.model.primitives.PrimitiveType<java.lang.String>
-
- ome.xml.model.primitives.Timestamp
-
public class Timestamp extends PrimitiveType<java.lang.String>
Primitive type that represents an ISO 8601 timestamp.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringISO8601_FORMAT_MSISO 8601 date output format with milliseconds.static java.lang.StringISO8601_FORMAT_SISO 8601 date output format without milliseconds.static org.joda.time.format.DateTimeFormatterISO8601_FORMATTER_MSISO 8601 date output formatter with milliseconds.static org.joda.time.format.DateTimeFormatterISO8601_FORMATTER_SISO 8601 date output formatter without milliseconds.static org.joda.time.format.DateTimeFormatterISO8601_PARSERISO 8601 date input formatter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.joda.time.DateTimeasDateTime(org.joda.time.DateTimeZone zone)Returns the timestamp as a JodaDateTimetype.org.joda.time.InstantasInstant()Returns the timestamp as a JodaDateTimetype.java.lang.StringtoString()static TimestampvalueOf(java.lang.String value)Returns aTimestampobject holding the value of the specified string, or null if parsing failed.-
Methods inherited from class ome.xml.model.primitives.PrimitiveType
equals, getValue
-
-
-
-
Field Detail
-
ISO8601_FORMAT_MS
public static final java.lang.String ISO8601_FORMAT_MS
ISO 8601 date output format with milliseconds.- See Also:
- Constant Field Values
-
ISO8601_FORMAT_S
public static final java.lang.String ISO8601_FORMAT_S
ISO 8601 date output format without milliseconds.- See Also:
- Constant Field Values
-
ISO8601_PARSER
public static final org.joda.time.format.DateTimeFormatter ISO8601_PARSER
ISO 8601 date input formatter.
-
ISO8601_FORMATTER_MS
public static final org.joda.time.format.DateTimeFormatter ISO8601_FORMATTER_MS
ISO 8601 date output formatter with milliseconds.
-
ISO8601_FORMATTER_S
public static final org.joda.time.format.DateTimeFormatter ISO8601_FORMATTER_S
ISO 8601 date output formatter without milliseconds.
-
-
Constructor Detail
-
Timestamp
public Timestamp(java.lang.String value) throws java.lang.IllegalArgumentException, java.lang.UnsupportedOperationException- Throws:
java.lang.IllegalArgumentExceptionjava.lang.UnsupportedOperationException
-
Timestamp
public Timestamp(org.joda.time.Instant instant)
-
Timestamp
public Timestamp(org.joda.time.DateTime datetime)
-
-
Method Detail
-
valueOf
public static Timestamp valueOf(java.lang.String value)
Returns aTimestampobject holding the value of the specified string, or null if parsing failed.- Parameters:
value- The string to be parsed.- Returns:
- See above.
-
asInstant
public org.joda.time.Instant asInstant()
Returns the timestamp as a JodaDateTimetype.- Returns:
- See above.
-
asDateTime
public org.joda.time.DateTime asDateTime(org.joda.time.DateTimeZone zone)
Returns the timestamp as a JodaDateTimetype.- Parameters:
zone- the DateTime instance uses the specified timezone, or the default zone if null.- Returns:
- See above.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classPrimitiveType<java.lang.String>
-
-