Record Class MultilineString
java.lang.Object
java.lang.Record
smile.util.ipynb.MultilineString
- Record Components:
lines- the individual lines that make up the string, each line retaining its trailing\nexcept possibly the last one.
A notebook multiline string value. The nbformat specification allows a field
such as
source or output text to be stored either as a single
string or as an array of strings (each line retaining its trailing newline).
This wrapper transparently handles both forms during (de)serialization and
exposes the content as a single concatenated String.
Serialization always produces an array of strings (one entry per line), matching the canonical nbformat 4 representation.
-
Constructor Summary
ConstructorsConstructorDescriptionMultilineString(List<String> lines) Creates an instance of aMultilineStringrecord 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.lines()Returns the value of thelinesrecord component.static MultilineStringCreates aMultilineStringfrom a plain string by splitting on newline boundaries while keeping the delimiter at the end of each line.final StringtoString()Returns a string representation of this record class.value()Returns the full content as a single concatenated string.
-
Constructor Details
-
MultilineString
-
-
Method Details
-
value
Returns the full content as a single concatenated string.- Returns:
- the joined string.
-
of
Creates aMultilineStringfrom a plain string by splitting on newline boundaries while keeping the delimiter at the end of each line.- Parameters:
text- the source text.- Returns:
- a new
MultilineString.
-
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). -
lines
-