Record Class DocumentTextPartModel

java.lang.Object
java.lang.Record
org.exoplatform.documents.mcp.model.DocumentTextPartModel
Record Components:
id - the document id
name - the document title
section - the heading whose section is read, null when reading by offset
offset - the character the part starts at
endOffset - the character after the part's last one
totalChars - the length of the whole text
nextOffset - where the next part starts, null when this one ends the text or the section
truncated - true when the whole text was cut at the most characters read from one document
text - the part's text

public record DocumentTextPartModel(String id, String name, DocumentHeadingModel section, long offset, long endOffset, long totalChars, Long nextOffset, boolean truncated, String text) extends Record
A part of a document's text, as read_document_text returns it, with where to read the next part.
  • Constructor Details

    • DocumentTextPartModel

      public DocumentTextPartModel(String id, String name, DocumentHeadingModel section, long offset, long endOffset, long totalChars, Long nextOffset, boolean truncated, String text)
      Creates an instance of a DocumentTextPartModel record class.
      Parameters:
      id - the value for the id record component
      name - the value for the name record component
      section - the value for the section record component
      offset - the value for the offset record component
      endOffset - the value for the endOffset record component
      totalChars - the value for the totalChars record component
      nextOffset - the value for the nextOffset record component
      truncated - the value for the truncated record component
      text - the value for the text record component
  • Method Details

    • 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 the compare method from their corresponding wrapper classes.
      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.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • section

      public DocumentHeadingModel section()
      Returns the value of the section record component.
      Returns:
      the value of the section record component
    • offset

      public long offset()
      Returns the value of the offset record component.
      Returns:
      the value of the offset record component
    • endOffset

      public long endOffset()
      Returns the value of the endOffset record component.
      Returns:
      the value of the endOffset record component
    • totalChars

      public long totalChars()
      Returns the value of the totalChars record component.
      Returns:
      the value of the totalChars record component
    • nextOffset

      public Long nextOffset()
      Returns the value of the nextOffset record component.
      Returns:
      the value of the nextOffset record component
    • truncated

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

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