Record Class TableBlock
java.lang.Object
java.lang.Record
com.nsdev.lettergenerator.model.block.TableBlock
- Record Components:
columnWeights- positive relative weights, one per physical columnheader- optional single repeating header row, null becomes emptyrows- ordered body rows containing cells at their first unoccupied columnstyle- nullable table typography and spacingoptions- optional appearance and row policies; null preserves legacy defaults
- All Implemented Interfaces:
Block
public record TableBlock(List<Double> columnWeights, List<TableCell> header, List<List<TableCell>> rows, Style style, TableOptions options)
extends Record
implements Block
Full-width native table with positive proportional column weights, an optional repeating header
and ordered body rows. Cells can span columns/rows; each section must cover its complete grid
without holes or overlap, and header spans cannot enter the body. Cell text inherits table, cell
and run styles in that order. Rich cells also support ordinary paragraphs, lists and images.
-
Constructor Summary
ConstructorsConstructorDescriptionTableBlock(List<Double> columnWeights, List<TableCell> header, List<List<TableCell>> rows, Style style) Preserves the original constructor with legacy cell appearance and row keeps.TableBlock(List<Double> columnWeights, List<TableCell> header, List<List<TableCell>> rows, Style style, TableOptions options) Snapshots all supplied collections, retaining null rows and entries for field-path errors. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecolumnWeightsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.header()Returns the value of theheaderrecord component.options()Returns the value of theoptionsrecord component.rows()Returns the value of therowsrecord component.style()Returns the value of thestylerecord component.final StringtoString()Returns a string representation of this record class.Replaces typography while preserving spans, content, appearance and row metadata.
-
Constructor Details
-
TableBlock
public TableBlock(List<Double> columnWeights, List<TableCell> header, List<List<TableCell>> rows, Style style, TableOptions options) Snapshots all supplied collections, retaining null rows and entries for field-path errors.- Parameters:
columnWeights- nullable relative column widthsheader- nullable repeating headerrows- nullable body rowsstyle- nullable table styleoptions- nullable appearance and row policies
-
TableBlock
public TableBlock(List<Double> columnWeights, List<TableCell> header, List<List<TableCell>> rows, Style style) Preserves the original constructor with legacy cell appearance and row keeps.- Parameters:
columnWeights- relative positive weightsheader- optional repeating headerrows- ordered body rowsstyle- nullable table style
-
-
Method Details
-
withStyle
Replaces typography while preserving spans, content, appearance and row metadata.- Parameters:
value- nullable replacement table style- Returns:
- immutable restyled table
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
columnWeights
Returns the value of thecolumnWeightsrecord component.- Returns:
- the value of the
columnWeightsrecord component
-
header
Returns the value of theheaderrecord component.- Returns:
- the value of the
headerrecord component
-
rows
Returns the value of therowsrecord component.- Returns:
- the value of the
rowsrecord component
-
style
Returns the value of thestylerecord component. -
options
Returns the value of theoptionsrecord component.- Returns:
- the value of the
optionsrecord component
-