Class DefaultHistory.EntryImpl

  • All Implemented Interfaces:
    History.Entry
    Enclosing class:
    DefaultHistory

    protected static class DefaultHistory.EntryImpl
    extends java.lang.Object
    implements History.Entry
    Default implementation of the History.Entry interface.

    This class represents a single history entry with an index, timestamp, and command text.

    • Constructor Summary

      Constructors 
      Constructor Description
      EntryImpl​(int index, java.time.Instant time, java.lang.String line)
      Creates a new history entry with the specified index, timestamp, and line.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int index()
      Returns the index of this entry in the history.
      java.lang.String line()
      Returns the command line text of this entry.
      java.time.Instant time()
      Returns the timestamp when this entry was added to the history.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • EntryImpl

        public EntryImpl​(int index,
                         java.time.Instant time,
                         java.lang.String line)
        Creates a new history entry with the specified index, timestamp, and line.
        Parameters:
        index - the index of the entry in the history
        time - the timestamp of the entry
        line - the content of the entry
    • Method Detail

      • index

        public int index()
        Description copied from interface: History.Entry
        Returns the index of this entry in the history.
        Specified by:
        index in interface History.Entry
        Returns:
        the index position of this entry
      • time

        public java.time.Instant time()
        Description copied from interface: History.Entry
        Returns the timestamp when this entry was added to the history.
        Specified by:
        time in interface History.Entry
        Returns:
        the timestamp of this entry
      • line

        public java.lang.String line()
        Description copied from interface: History.Entry
        Returns the command line text of this entry.
        Specified by:
        line in interface History.Entry
        Returns:
        the command line text
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object