Record Class RecordParser.ParsedRecord

java.lang.Object
java.lang.Record
com.tnsai.rag.files.RecordParser.ParsedRecord
Record Components:
timestamp - the time it was written, yyyy-MM-dd HH:mm:ss
level - the log level; empty in a history
episodeState - the episode state it was written in
conversationField - the conversation field as written; empty on a line without it
writer - the logger name in a log; in a history the agent's name, or empty when the line does not start with it
message - what follows the writer
Enclosing class:
RecordParser

public static record RecordParser.ParsedRecord(String timestamp, Optional<String> level, String episodeState, Optional<String> conversationField, String writer, String message) extends Record
The first line of a record.
Since:
0.18.6
  • Constructor Details

  • Method Details

    • hasConversationField

      public boolean hasConversationField()
      Whether the line carries the conversation field, as every line written with AgentRecordFormat's patterns does.
      Returns:
      true when the field is present
    • conversationId

      public Optional<String> conversationId()
      The conversation the line belongs to.
      Returns:
      the id; empty when the field is absent, blank or "-"
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • timestamp

      public String timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component
    • level

      public Optional<String> level()
      Returns the value of the level record component.
      Returns:
      the value of the level record component
    • episodeState

      public String episodeState()
      Returns the value of the episodeState record component.
      Returns:
      the value of the episodeState record component
    • conversationField

      public Optional<String> conversationField()
      Returns the value of the conversationField record component.
      Returns:
      the value of the conversationField record component
    • writer

      public String writer()
      Returns the value of the writer record component.
      Returns:
      the value of the writer record component
    • message

      public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component