Class DefaultHistory.EntryImpl

java.lang.Object
org.jline.reader.impl.history.DefaultHistory.EntryImpl
All Implemented Interfaces:
History.Entry
Enclosing class:
DefaultHistory

protected static class DefaultHistory.EntryImpl extends 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 Details

    • EntryImpl

      public EntryImpl(int index, Instant time, 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 Details

    • 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 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 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 String toString()
      Overrides:
      toString in class Object