Interface TimestampValue

All Superinterfaces:
Comparable<FieldValue>, FieldValue

public interface TimestampValue extends FieldValue
TimestampValue extends FieldValue to represent a Timestamp value.
Since:
4.3
  • Method Details

    • get

      Timestamp get()
      Get the Timestamp value of this object.
      Returns:
      the Timestamp value
    • clone

      Create a deep copy of this object.
      Specified by:
      clone in interface FieldValue
      Returns:
      a deep copy of this object
    • toString

      String toString()
      Formats the Timestamp value to a string with the default pattern TimestampDef.DEFAULT_PATTERN in UTC zone.
      Overrides:
      toString in class Object
      Returns:
      the formatted string
      Throws:
      IllegalArgumentException - if failed to format the Timestamp value to a string with default pattern.
    • toString

      String toString(String pattern, boolean withZoneUTC)
      Formats the Timestamp value to a string with the specified pattern.
      Parameters:
      pattern - the pattern for the timestampString. If null, then default pattern TimestampDef.DEFAULT_PATTERN is used to format to a string. The symbols that can be used to specify a pattern are described in DateTimeFormatter.
      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.