Record Class CellAppearance
java.lang.Object
java.lang.Record
com.nsdev.lettergenerator.model.table.CellAppearance
- Record Components:
border- optional uniform border, in pointspadding- optional per-edge inner spacing, in millimetersverticalAlignment- optional content alignmentbackgroundColor- 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 Summary
FieldsModifier and TypeFieldDescriptionstatic final CellAppearanceComplete legacy defaults; the background remains transparent. -
Constructor Summary
ConstructorsConstructorDescriptionCellAppearance(Border border, Padding padding, VerticalAlignment verticalAlignment, String backgroundColor) Creates an instance of aCellAppearancerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebackgroundColorrecord component.border()Returns the value of theborderrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.overlay(CellAppearance local) Overlays specified local properties independently, including zero padding and no border.padding()Returns the value of thepaddingrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theverticalAlignmentrecord component.
-
Field Details
-
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 aCellAppearancerecord class.- Parameters:
border- the value for theborderrecord componentpadding- the value for thepaddingrecord componentverticalAlignment- the value for theverticalAlignmentrecord componentbackgroundColor- the value for thebackgroundColorrecord component
-
-
Method Details
-
overlay
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
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). -
border
Returns the value of theborderrecord component.- Returns:
- the value of the
borderrecord component
-
padding
Returns the value of thepaddingrecord component.- Returns:
- the value of the
paddingrecord component
-
verticalAlignment
Returns the value of theverticalAlignmentrecord component.- Returns:
- the value of the
verticalAlignmentrecord component
-
backgroundColor
Returns the value of thebackgroundColorrecord component.- Returns:
- the value of the
backgroundColorrecord component
-