Record Class LetterTheme

java.lang.Object
java.lang.Record
com.nsdev.lettergenerator.theme.LetterTheme
Record Components:
roles - role defaults; null means no role overrides
namedStyles - reusable named overrides; null means no named styles
tableAppearance - optional table geometry/paint defaults
stationery - optional repeating region defaults

public record LetterTheme(Map<StyleRole,Style> roles, Map<String,Style> namedStyles, TableAppearance tableAppearance, Stationery stationery) extends Record
Immutable per-document role defaults and named styles. Theme values never modify global state. Each nullable style property inherits independently; explicit document, section and content overrides take precedence over role defaults. Named styles may reference another named style through Style.styleName(); generation rejects unknown names and cycles.
  • Constructor Details

    • LetterTheme

      public LetterTheme(Map<StyleRole,Style> roles, Map<String,Style> namedStyles, TableAppearance tableAppearance, Stationery stationery)
      Snapshots both maps, preserving registration order and invalid entries for validation.
      Parameters:
      roles - nullable role map
      namedStyles - nullable named-style map
      tableAppearance - optional table appearance
      stationery - optional fixed regions
    • LetterTheme

      public LetterTheme(Map<StyleRole,Style> roles, Map<String,Style> namedStyles)
      Preserves themes that configure only typography.
      Parameters:
      roles - role defaults
      namedStyles - named registrations
  • Method Details

    • builder

      public static LetterTheme.Builder builder()
      Returns:
      a new independent builder with no role or named defaults
    • 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.
    • roles

      public Map<StyleRole,Style> roles()
      Returns the value of the roles record component.
      Returns:
      the value of the roles record component
    • namedStyles

      public Map<String,Style> namedStyles()
      Returns the value of the namedStyles record component.
      Returns:
      the value of the namedStyles record component
    • tableAppearance

      public TableAppearance tableAppearance()
      Returns the value of the tableAppearance record component.
      Returns:
      the value of the tableAppearance record component
    • stationery

      public Stationery stationery()
      Returns the value of the stationery record component.
      Returns:
      the value of the stationery record component