Record Class CellBorders

java.lang.Object
java.lang.Record
io.leandev.appfuse.report.node.CellBorders
Record Components:
top - 上邊
right - 右邊
bottom - 下邊
left - 左邊

public record CellBorders(LineStyle top, LineStyle right, LineStyle bottom, LineStyle left) extends Record
儲存格四邊框線覆寫;null 繼承上一層,零線寬明確不畫。 線條位於儲存格外緣,不增加內距或列高;跨欄只畫合併後的外緣。 每個跨頁實體片段重複指定的四邊,相鄰邊各自繪製。一般格依列由上到下、格由左到右; 跨列格於整筆其他列之後,依起始列及欄位順序繪製。 不提供 CSS border-collapse;共用邊需一致外觀時指定相同樣式或僅保留其中一邊。
Since:
4.0.0
  • Constructor Details

    • CellBorders

      public CellBorders(LineStyle top, LineStyle right, LineStyle bottom, LineStyle left)
      Creates an instance of a CellBorders record class.
      Parameters:
      top - the value for the top record component
      right - the value for the right record component
      bottom - the value for the bottom record component
      left - the value for the left record component
  • Method Details

    • inherit

      public static CellBorders inherit()
      Returns:
      全部邊繼承的空覆寫
    • all

      public static CellBorders all(LineStyle line)
      Parameters:
      line - 四邊相同的樣式;null 表示各邊繼承
      Returns:
      四邊相同的新覆寫
    • none

      public static CellBorders none()
      Returns:
      四邊明確不畫的覆寫
    • withTop

      public CellBorders withTop(LineStyle line)
      Parameters:
      line - 上邊樣式;null 表示繼承
      Returns:
      新覆寫
    • withRight

      public CellBorders withRight(LineStyle line)
      Parameters:
      line - 右邊樣式;null 表示繼承
      Returns:
      新覆寫
    • withBottom

      public CellBorders withBottom(LineStyle line)
      Parameters:
      line - 下邊樣式;null 表示繼承
      Returns:
      新覆寫
    • withLeft

      public CellBorders withLeft(LineStyle line)
      Parameters:
      line - 左邊樣式;null 表示繼承
      Returns:
      新覆寫
    • overlay

      public CellBorders overlay(CellBorders override)
      各邊獨立繼承;零寬不會被當成未設定。
      Parameters:
      override - 各邊覆寫;null 視同空覆寫
      Returns:
      合併後的新樣式,空覆寫時可回傳自身
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • top

      public LineStyle top()
      Returns the value of the top record component.
      Returns:
      the value of the top record component
    • right

      public LineStyle right()
      Returns the value of the right record component.
      Returns:
      the value of the right record component
    • bottom

      public LineStyle bottom()
      Returns the value of the bottom record component.
      Returns:
      the value of the bottom record component
    • left

      public LineStyle left()
      Returns the value of the left record component.
      Returns:
      the value of the left record component