Record Class CellAppearance

java.lang.Object
java.lang.Record
com.nsdev.lettergenerator.model.table.CellAppearance
Record Components:
border - optional uniform border, in points
padding - optional per-edge inner spacing, in millimeters
verticalAlignment - optional content alignment
backgroundColor - optional six-digit RGB fill; null inherits the table fill

public record CellAppearance(Border border, Padding padding, VerticalAlignment verticalAlignment, String backgroundColor) extends Record
Nullable cell appearance overrides. Each property inherits independently, first from table defaults and then from the legacy defaults. Text properties remain in the cell's Style.
  • Field Details

    • DEFAULT

      public static final CellAppearance DEFAULT
      Complete legacy defaults; the background remains transparent.
  • Constructor Details

    • CellAppearance

      public CellAppearance(Border border, Padding padding, VerticalAlignment verticalAlignment, String backgroundColor)
      Creates an instance of a CellAppearance record class.
      Parameters:
      border - the value for the border record component
      padding - the value for the padding record component
      verticalAlignment - the value for the verticalAlignment record component
      backgroundColor - the value for the backgroundColor record component
  • Method Details

    • overlay

      public CellAppearance overlay(CellAppearance local)
      Overlays specified local properties independently, including zero padding and no border.
      Parameters:
      local - optional local appearance
      Returns:
      combined immutable appearance, or this instance when local is null
    • 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.
    • border

      public Border border()
      Returns the value of the border record component.
      Returns:
      the value of the border record component
    • padding

      public Padding padding()
      Returns the value of the padding record component.
      Returns:
      the value of the padding record component
    • verticalAlignment

      public VerticalAlignment verticalAlignment()
      Returns the value of the verticalAlignment record component.
      Returns:
      the value of the verticalAlignment record component
    • backgroundColor

      public String backgroundColor()
      Returns the value of the backgroundColor record component.
      Returns:
      the value of the backgroundColor record component