Record Class TableRow

java.lang.Object
java.lang.Record
io.leandev.appfuse.report.node.TableRow
Record Components:
cells - 儲存格;colSpan 加上前列跨列佔用必須填滿欄數
role - 列角色
groupPath - 所屬群組路徑,例如 ["台北信義門市", "2026-01"];無群組時為空
keepWithNext - 是否與下一列保持同頁(群組標題預設為 true)
splittable - 單列高於整頁時是否允許在列內分頁
style - 單列樣式;null 沿用既有表格行為
recordStart - 是否開始新邏輯紀錄;預設 true,false 延續前一列的紀錄

public record TableRow(List<Cell> cells, RowRole role, List<String> groupPath, boolean keepWithNext, boolean splittable, TableRowStyle style, boolean recordStart) extends Record
表格列
Since:
4.0.0
  • Constructor Details

    • TableRow

      public TableRow(List<Cell> cells, RowRole role, List<String> groupPath, boolean keepWithNext, boolean splittable)
      相容既有五參數建構器
    • TableRow

      public TableRow(List<Cell> cells, RowRole role, List<String> groupPath, boolean keepWithNext, boolean splittable, TableRowStyle style, boolean recordStart)
      Creates an instance of a TableRow record class.
      Parameters:
      cells - the value for the cells record component
      role - the value for the role record component
      groupPath - the value for the groupPath record component
      keepWithNext - the value for the keepWithNext record component
      splittable - the value for the splittable record component
      style - the value for the style record component
      recordStart - the value for the recordStart record component
  • Method Details

    • detail

      public static TableRow detail(Cell... cells)
      不屬於任何群組的明細列
      Parameters:
      cells - 儲存格
      Returns:
      明細列
    • detail

      public static TableRow detail(String... texts)
      由純文字建立不屬於任何群組的明細列
      Parameters:
      texts - 每格文字
      Returns:
      明細列
    • of

      public static TableRow of(RowRole role, List<String> groupPath, List<Cell> cells)
      指定角色與群組路徑的列;群組標題預設與下一列保持同頁
      Parameters:
      role - 角色
      groupPath - 群組路徑
      cells - 儲存格
      Returns:
      表格列
    • withKeepWithNext

      public TableRow withKeepWithNext(boolean keepWithNext)
    • withSplittable

      public TableRow withSplittable(boolean splittable)
    • withStyle

      public TableRow withStyle(TableRowStyle style)
    • withRecordStart

      public TableRow withRecordStart(boolean recordStart)
      false 將本列接到上一列的紀錄;啟用表格紀錄上限時整筆不可拆頁
    • 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.
    • cells

      public List<Cell> cells()
      Returns the value of the cells record component.
      Returns:
      the value of the cells record component
    • role

      public RowRole role()
      Returns the value of the role record component.
      Returns:
      the value of the role record component
    • groupPath

      public List<String> groupPath()
      Returns the value of the groupPath record component.
      Returns:
      the value of the groupPath record component
    • keepWithNext

      public boolean keepWithNext()
      Returns the value of the keepWithNext record component.
      Returns:
      the value of the keepWithNext record component
    • splittable

      public boolean splittable()
      Returns the value of the splittable record component.
      Returns:
      the value of the splittable record component
    • style

      public TableRowStyle style()
      Returns the value of the style record component.
      Returns:
      the value of the style record component
    • recordStart

      public boolean recordStart()
      Returns the value of the recordStart record component.
      Returns:
      the value of the recordStart record component