Record Class DocumentTextPage
java.lang.Object
java.lang.Record
org.exoplatform.documents.model.DocumentTextPage
- Record Components:
text- the characters read, null when there is no textoffset- the character the part starts attotalChars- the length of the whole texttruncated- true when the whole text was cut at the most characters read from one document, so its end is missingoutline- the document's headings, in the order they appear, empty when it has nonestatus-DocumentTextContent.Status.EXTRACTEDwith a text, else why there is none
public record DocumentTextPage(String text, long offset, long totalChars, boolean truncated, List<DocumentOutlineEntry> outline, DocumentTextContent.Status status)
extends Record
A part of a document's text, read from where the caller asks, with what is
needed to read the rest: the length of the whole text and the document's
outline. When there is no text, its status says why.
-
Constructor Summary
ConstructorsConstructorDescriptionDocumentTextPage(String text, long offset, long totalChars, boolean truncated, List<DocumentOutlineEntry> outline, DocumentTextContent.Status status) Creates an instance of aDocumentTextPagerecord class. -
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.booleanhasText()Whether the document's text was read, even when the part asked lies past its end.static DocumentTextPagenone(DocumentTextContent.Status status) Builds the answer for a document whose text could not be read.longoffset()Returns the value of theoffsetrecord component.outline()Returns the value of theoutlinerecord component.status()Returns the value of thestatusrecord component.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalCharsrecord component.booleanReturns the value of thetruncatedrecord component.
-
Constructor Details
-
DocumentTextPage
public DocumentTextPage(String text, long offset, long totalChars, boolean truncated, List<DocumentOutlineEntry> outline, DocumentTextContent.Status status) Creates an instance of aDocumentTextPagerecord class.- Parameters:
text- the value for thetextrecord componentoffset- the value for theoffsetrecord componenttotalChars- the value for thetotalCharsrecord componenttruncated- the value for thetruncatedrecord componentoutline- the value for theoutlinerecord componentstatus- the value for thestatusrecord component
-
-
Method Details
-
none
Builds the answer for a document whose text could not be read.- Parameters:
status- why there is no text- Returns:
- a page holding no text
-
hasText
public boolean hasText()Whether the document's text was read, even when the part asked lies past its end.- Returns:
- true when the status is
DocumentTextContent.Status.EXTRACTED
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
text
-
offset
-
totalChars
public long totalChars()Returns the value of thetotalCharsrecord component.- Returns:
- the value of the
totalCharsrecord component
-
truncated
-
outline
-
status
-