Package io.keikai.axyra.sheets.content
Record Class CommentRun
java.lang.Object
java.lang.Record
io.keikai.axyra.sheets.content.CommentRun
- Record Components:
text- the literal run textfontName- the font name, or null for the default note fontfontSize- the font size in points, or null for the defaultbold- bolditalic- italicunderline- underlinestrikethrough- strikethroughcolor- the font color as ARGB hex ("FFFF0000"), or null
public record CommentRun(String text, String fontName, Double fontSize, boolean bold, boolean italic, boolean underline, boolean strikethrough, String color)
extends Record
One formatted run of a rich-text cell comment (note) — ECMA-376 Part 1
§18.7.7
comment/text/r. Build runs with of(String) and
the with… copies:
cell.setRichComment("Ann",
CommentRun.of("Status: "),
CommentRun.of("APPROVED").withBold().withColor("FF008000"));
-
Constructor Summary
ConstructorsConstructorDescriptionCommentRun(String text, String fontName, Double fontSize, boolean bold, boolean italic, boolean underline, boolean strikethrough, String color) Creates an instance of aCommentRunrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbold()Returns the value of theboldrecord component.color()Returns the value of thecolorrecord component.final booleanIndicates whether some other object is "equal to" this one.fontName()Returns the value of thefontNamerecord component.fontSize()Returns the value of thefontSizerecord component.final inthashCode()Returns a hash code value for this object.booleanitalic()Returns the value of theitalicrecord component.static CommentRunA run oftextwith the default note formatting.booleanReturns the value of thestrikethroughrecord component.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of theunderlinerecord component.withBold()A copy with bold on.A copy with the given ARGB font color ("FFFF0000").A copy with the given font name and size (either may be null).A copy with italic on.A copy with strikethrough on.A copy with underline on.
-
Constructor Details
-
CommentRun
public CommentRun(String text, String fontName, Double fontSize, boolean bold, boolean italic, boolean underline, boolean strikethrough, String color) Creates an instance of aCommentRunrecord class.- Parameters:
text- the value for thetextrecord componentfontName- the value for thefontNamerecord componentfontSize- the value for thefontSizerecord componentbold- the value for theboldrecord componentitalic- the value for theitalicrecord componentunderline- the value for theunderlinerecord componentstrikethrough- the value for thestrikethroughrecord componentcolor- the value for thecolorrecord component
-
-
Method Details
-
of
A run oftextwith the default note formatting. -
withBold
A copy with bold on. -
withItalic
A copy with italic on. -
withUnderline
A copy with underline on. -
withStrikethrough
A copy with strikethrough on. -
withColor
A copy with the given ARGB font color ("FFFF0000"). -
withFont
A copy with the given font name and size (either may be null). -
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 '=='. -
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-
fontName
Returns the value of thefontNamerecord component.- Returns:
- the value of the
fontNamerecord component
-
fontSize
Returns the value of thefontSizerecord component.- Returns:
- the value of the
fontSizerecord component
-
bold
public boolean bold()Returns the value of theboldrecord component.- Returns:
- the value of the
boldrecord component
-
italic
public boolean italic()Returns the value of theitalicrecord component.- Returns:
- the value of the
italicrecord component
-
underline
public boolean underline()Returns the value of theunderlinerecord component.- Returns:
- the value of the
underlinerecord component
-
strikethrough
public boolean strikethrough()Returns the value of thestrikethroughrecord component.- Returns:
- the value of the
strikethroughrecord component
-
color
Returns the value of thecolorrecord component.- Returns:
- the value of the
colorrecord component
-