Record Class RecordInterpreter.Reading

java.lang.Object
java.lang.Record
com.tnsai.rag.files.RecordInterpreter.Reading
Record Components:
kind - what the record is
text - the message as its first line gives it; empty for a note or a record left out. The record's following lines are appended to it.
truncated - whether the writer kept only the message's start
message - the message within the record's whole text, for a record that wraps it, such as a prompt quoting it; identity otherwise
Enclosing interface:
RecordInterpreter

public static record RecordInterpreter.Reading(RecordInterpreter.Reading.Kind kind, String text, boolean truncated, UnaryOperator<String> message) extends Record
What a record is.
Since:
0.18.6
  • Constructor Details

  • Method Details

    • note

      public static RecordInterpreter.Reading note()
      A note: indexed, and given once among records noting the same text.
      Returns:
      the reading
    • leftOut

      public static RecordInterpreter.Reading leftOut()
      A record not indexed, with the lines that follow it.
      Returns:
      the reading
    • told

      public static RecordInterpreter.Reading told(String text, boolean truncated)
      A message the agent was told. A record of being told the message the request answers is not returned.
      Parameters:
      text - the message as the first line gives it
      truncated - whether the writer kept only its start
      Returns:
      the reading
    • said

      public static RecordInterpreter.Reading said(String text, boolean truncated)
      A message the agent said.
      Parameters:
      text - the message as the first line gives it
      truncated - whether the writer kept only its start
      Returns:
      the reading
    • unwrappedBy

      public RecordInterpreter.Reading unwrappedBy(UnaryOperator<String> message)
      This reading with the message taken out of the record's whole text by message.
      Parameters:
      message - gives the message within the text, or the text when it holds none
      Returns:
      the reading
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • kind

      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • text

      public String text()
      Returns the value of the text record component.
      Returns:
      the value of the text record component
    • truncated

      public boolean truncated()
      Returns the value of the truncated record component.
      Returns:
      the value of the truncated record component
    • message

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