Record Class Cell

java.lang.Object
java.lang.Record
io.leandev.appfuse.report.node.Cell
Record Components:
blocks - 內容
align - 選填的段落預設對齊
verticalAlign - 選填的垂直對齊;null 表示靠上
colSpan - 跨欄數(≥ 1)
borders - 各邊框線覆寫;null 繼承表格
rowSpan - 跨列數(1~256);僅允許不可拆的邏輯紀錄內,續列省略已占用欄位

public record Cell(List<Block> blocks, Align align, VerticalAlign verticalAlign, int colSpan, CellBorders borders, int rowSpan) extends Record

表格儲存格

內容是受限的區塊清單,只允許 Paragraph、Image、Figure、Spacer。 對齊的優先順序為:段落自身的 ParagraphStyle.align() → 本儲存格的 align → 欄的預設對齊。

Since:
4.0.0
  • Constructor Details

    • Cell

      public Cell(List<Block> blocks, Align align, VerticalAlign verticalAlign, int colSpan)
      保留既有四參數建構器。
    • Cell

      public Cell(List<Block> blocks, Align align, VerticalAlign verticalAlign, int colSpan, CellBorders borders, int rowSpan)
      Creates an instance of a Cell record class.
      Parameters:
      blocks - the value for the blocks record component
      align - the value for the align record component
      verticalAlign - the value for the verticalAlign record component
      colSpan - the value for the colSpan record component
      borders - the value for the borders record component
      rowSpan - the value for the rowSpan record component
  • Method Details

    • of

      public static Cell of(String text)
      單一純文字段落的儲存格
      Parameters:
      text - 文字
      Returns:
      儲存格
    • of

      public static Cell of(Inline... inlines)
      單一段落的儲存格
      Parameters:
      inlines - 行內節點
      Returns:
      儲存格
    • withColSpan

      public Cell withColSpan(int colSpan)
    • withAlign

      public Cell withAlign(Align align)
    • withVerticalAlign

      public Cell withVerticalAlign(VerticalAlign verticalAlign)
    • withRowSpan

      public Cell withRowSpan(int rowSpan)
      Parameters:
      rowSpan - 同筆紀錄內跨列數(1~256)
      Returns:
      新儲存格;複製其他設定
    • withBorders

      public Cell withBorders(CellBorders borders)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • blocks

      public List<Block> blocks()
      Returns the value of the blocks record component.
      Returns:
      the value of the blocks record component
    • align

      public Align align()
      Returns the value of the align record component.
      Returns:
      the value of the align record component
    • verticalAlign

      public VerticalAlign verticalAlign()
      Returns the value of the verticalAlign record component.
      Returns:
      the value of the verticalAlign record component
    • colSpan

      public int colSpan()
      Returns the value of the colSpan record component.
      Returns:
      the value of the colSpan record component
    • borders

      public CellBorders borders()
      Returns the value of the borders record component.
      Returns:
      the value of the borders record component
    • rowSpan

      public int rowSpan()
      Returns the value of the rowSpan record component.
      Returns:
      the value of the rowSpan record component