Record Class DocumentTextContent
java.lang.Object
java.lang.Record
org.exoplatform.documents.model.DocumentTextContent
- Record Components:
text- the text of the file, null when none could be obtainedstatus- where the text came from, or why there is none
The text of a document file, together with where it came from or, when there
is none, why: the search index when it already holds the file's text, the file
itself when it does not, or the reason neither could give any.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhere the text of a file came from, or why there is none. -
Constructor Summary
ConstructorsConstructorDescriptionDocumentTextContent(String text, DocumentTextContent.Status status) Creates an instance of aDocumentTextContentrecord 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 a non-blank text was obtained.static DocumentTextContentnone(DocumentTextContent.Status status) Builds the content of a file whose text could not be obtained.static DocumentTextContentof(String text, DocumentTextContent.Status status) Builds the content of a file whose text was found.status()Returns the value of thestatusrecord component.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
of
Builds the content of a file whose text was found.- Parameters:
text- the text of the filestatus-DocumentTextContent.Status.INDEXEDorDocumentTextContent.Status.EXTRACTED- Returns:
- the content holding that text
-
none
Builds the content of a file whose text could not be obtained.- Parameters:
status- why there is no text- Returns:
- the content holding no text
-
hasText
public boolean hasText()Whether a non-blank text was obtained.- Returns:
- true when
text()holds something to read
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
text
-
status
-