Interface Timestamped

All Known Implementing Classes:
Choice, Connect, End, Error, Join, Message, Report, Session.Event, Session.Report, Session.Result, Start, Stop, Timestamped.Adapter, Update

public interface Timestamped
A timestamped object records the moment it was created.
Author:
Stephen G. Ware
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    An implementation of the Timestamped interface.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final DateTimeFormatter
    The format used for printing timestamps as text
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the time this object was created as the number of milliseconds from the epoch (1970-01-01T00:00:00Z) in Coordinated Universal Time (UTC).
    static String
    toString(long time)
    Formats an instant in time as concise, human-readable text.
    static String
    toString(Instant instant)
    Formats an instant in time as concise, human-readable text.
  • Field Details

    • FORMAT

      static final DateTimeFormatter FORMAT
      The format used for printing timestamps as text
  • Method Details

    • toString

      static String toString(Instant instant)
      Formats an instant in time as concise, human-readable text.
      Parameters:
      instant - an instant in time
      Returns:
      a concise, human-readable text representation of that instant
    • toString

      static String toString(long time)
      Formats an instant in time as concise, human-readable text.
      Parameters:
      time - an instant in time as the number of milliseconds from the epoch (1970-01-01T00:00:00Z) in Coordinated Universal Time (UTC)
      Returns:
      a concise, human-readable text representation of that instant
    • getTimestamp

      long getTimestamp()
      Returns the time this object was created as the number of milliseconds from the epoch (1970-01-01T00:00:00Z) in Coordinated Universal Time (UTC).
      Returns:
      the object's timestamp in milliseconds from the epoch in UTC