Package com.nsdev.lettergenerator.theme
Record Class LetterTheme
java.lang.Object
java.lang.Record
com.nsdev.lettergenerator.theme.LetterTheme
- Record Components:
roles- role defaults; null means no role overridesnamedStyles- reusable named overrides; null means no named stylestableAppearance- optional table geometry/paint defaultsstationery- 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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classMutable accumulator whose built themes own snapshots of both registrations. -
Constructor Summary
ConstructorsConstructorDescriptionPreserves themes that configure only typography.LetterTheme(Map<StyleRole, Style> roles, Map<String, Style> namedStyles, TableAppearance tableAppearance, Stationery stationery) Snapshots both maps, preserving registration order and invalid entries for validation. -
Method Summary
Modifier and TypeMethodDescriptionstatic LetterTheme.Builderbuilder()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thenamedStylesrecord component.roles()Returns the value of therolesrecord component.Returns the value of thestationeryrecord component.Returns the value of thetableAppearancerecord component.final StringtoString()Returns a string representation of this record class.
-
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 mapnamedStyles- nullable named-style maptableAppearance- optional table appearancestationery- optional fixed regions
-
LetterTheme
Preserves themes that configure only typography.- Parameters:
roles- role defaultsnamedStyles- named registrations
-
-
Method Details
-
builder
- Returns:
- a new independent builder with no role or named defaults
-
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). -
roles
Returns the value of therolesrecord component.- Returns:
- the value of the
rolesrecord component
-
namedStyles
Returns the value of thenamedStylesrecord component.- Returns:
- the value of the
namedStylesrecord component
-
tableAppearance
Returns the value of thetableAppearancerecord component.- Returns:
- the value of the
tableAppearancerecord component
-
stationery
Returns the value of thestationeryrecord component.- Returns:
- the value of the
stationeryrecord component
-