Package com.tnsai.rag.files
Record Class RecordInterpreter.Reading
java.lang.Object
java.lang.Record
com.tnsai.rag.files.RecordInterpreter.Reading
- Record Components:
kind- what the record istext- 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 startmessage- 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
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionReading(RecordInterpreter.Reading.Kind kind, String text, boolean truncated, UnaryOperator<String> message) Validates the components. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.kind()Returns the value of thekindrecord component.static RecordInterpreter.ReadingleftOut()A record not indexed, with the lines that follow it.message()Returns the value of themessagerecord component.static RecordInterpreter.Readingnote()A note: indexed, and given once among records noting the same text.static RecordInterpreter.ReadingA message the agent said.text()Returns the value of thetextrecord component.static RecordInterpreter.ReadingA message the agent was told.final StringtoString()Returns a string representation of this record class.booleanReturns the value of thetruncatedrecord component.unwrappedBy(UnaryOperator<String> message) This reading with the message taken out of the record's whole text bymessage.
-
Constructor Details
-
Reading
public Reading(RecordInterpreter.Reading.Kind kind, String text, boolean truncated, UnaryOperator<String> message) Validates the components.
-
-
Method Details
-
note
A note: indexed, and given once among records noting the same text.- Returns:
- the reading
-
leftOut
A record not indexed, with the lines that follow it.- Returns:
- the reading
-
told
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 ittruncated- whether the writer kept only its start- Returns:
- the reading
-
said
A message the agent said.- Parameters:
text- the message as the first line gives ittruncated- whether the writer kept only its start- Returns:
- the reading
-
unwrappedBy
This reading with the message taken out of the record's whole text bymessage.- Parameters:
message- gives the message within the text, or the text when it holds none- Returns:
- the reading
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-
truncated
public boolean truncated()Returns the value of thetruncatedrecord component.- Returns:
- the value of the
truncatedrecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-