Package oracle.kv.table
Interface TimestampValue
- All Superinterfaces:
Comparable<FieldValue>
,FieldValue
TimestampValue extends
FieldValue
to represent a Timestamp value.- Since:
- 4.3
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Create a deep copy of this object.get()
Get the Timestamp value of this object.int
getDay()
Returns the day of the Timestamp represented by this TimestampValue object.int
Returns the fractional seconds of the Timestamp represented by this TimestampValue object.int
getHour()
Returns the hour of the Timestamp represented by this TimestampValue object.int
Returns the minute of the Timestamp represented by this TimestampValue object.int
getMonth()
Returns the month of the Timestamp represented by this TimestampValue object.int
getNano()
Returns the nanoseconds of the Timestamp represented by this TimestampValue object.int
Returns the second of the Timestamp represented by this TimestampValue object.int
getYear()
Returns the year of the Timestamp represented by this TimestampValue object.toString()
Formats the Timestamp value to a string with the default patternTimestampDef.DEFAULT_PATTERN
in UTC zone.Formats the Timestamp value to a string with the specified pattern.Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface oracle.kv.table.FieldValue
asArray, asBinary, asBoolean, asDouble, asEnum, asFixedBinary, asFloat, asIndexKey, asInteger, asLong, asMap, asNumber, asPrimaryKey, asRecord, asRow, asString, asTimestamp, getDefinition, getType, isArray, isAtomic, isBinary, isBoolean, isComplex, isDouble, isEMPTY, isEnum, isFixedBinary, isFloat, isIndexKey, isInteger, isJsonNull, isLong, isMap, isNull, isNumber, isNumeric, isPrimaryKey, isRecord, isRow, isString, isTimestamp, toJsonString
-
Method Details
-
get
Timestamp get()Get the Timestamp value of this object.- Returns:
- the Timestamp value
-
clone
TimestampValue clone()Create a deep copy of this object.- Specified by:
clone
in interfaceFieldValue
- Returns:
- a deep copy of this object
-
toString
String toString()Formats the Timestamp value to a string with the default patternTimestampDef.DEFAULT_PATTERN
in UTC zone.- Overrides:
toString
in classObject
- Returns:
- the formatted string
- Throws:
IllegalArgumentException
- if failed to format the Timestamp value to a string with default pattern.
-
toString
Formats the Timestamp value to a string with the specified pattern.- Parameters:
pattern
- the pattern for the timestampString. If null, then default patternTimestampDef.DEFAULT_PATTERN
is used to format to a string. The symbols that can be used to specify a pattern are described inDateTimeFormatter
.withZoneUTC
- true if use UTC zone, otherwise the local time zone is used.- Returns:
- the formatted string
- Throws:
IllegalArgumentException
- if failed to format the Timestamp value to a string in format of given pattern.
-
getYear
int getYear()Returns the year of the Timestamp represented by this TimestampValue object.- Returns:
- the year
-
getMonth
int getMonth()Returns the month of the Timestamp represented by this TimestampValue object.- Returns:
- the month
-
getDay
int getDay()Returns the day of the Timestamp represented by this TimestampValue object.- Returns:
- the day
-
getHour
int getHour()Returns the hour of the Timestamp represented by this TimestampValue object.- Returns:
- the hour
-
getMinute
int getMinute()Returns the minute of the Timestamp represented by this TimestampValue object.- Returns:
- the minute
-
getSecond
int getSecond()Returns the second of the Timestamp represented by this TimestampValue object.- Returns:
- the second
-
getNano
int getNano()Returns the nanoseconds of the Timestamp represented by this TimestampValue object.- Returns:
- the nanoseconds
-
getFracSecond
int getFracSecond()Returns the fractional seconds of the Timestamp represented by this TimestampValue object. The range of the number returned depends on the precision of the timestamp value. For example, if the precision is 3 (milli seconds), the number will be between 0 and 999. If the precision is 0, the returned number will always be 0.- Returns:
- the fractional seconds.
-