Record Class DocumentSettings

java.lang.Object
java.lang.Record
com.nsdev.lettergenerator.model.DocumentSettings
Record Components:
locale - country-aware formatting, null selects stable defaults
metadata - optional PDF metadata
direction - optional explicit direction; null retains ordinary left-to-right behavior
fallbackFonts - ordered registered family names, null becomes empty
hyphenate - whether registered language patterns should be used, null means false

public record DocumentSettings(LocaleSettings locale, DocumentMetadata metadata, TextDirection direction, List<String> fallbackFonts, Boolean hyphenate) extends Record
Optional language, formatting, metadata and explicit font fallback settings. No system-font scanning or JVM default locale/time zone participates.
  • Constructor Details

    • DocumentSettings

      public DocumentSettings(LocaleSettings locale, DocumentMetadata metadata, TextDirection direction, List<String> fallbackFonts, Boolean hyphenate)
      Snapshots options and supplies deterministic formatting defaults.
      Parameters:
      locale - optional formatting settings
      metadata - optional PDF metadata
      direction - optional writing direction
      fallbackFonts - optional ordered fallback families
      hyphenate - optional dictionary-based hyphenation
  • Method Details

    • defaults

      public static DocumentSettings defaults()
      Returns:
      defaults that preserve ordinary letter output
    • withLocale

      public DocumentSettings withLocale(LocaleSettings value)
      Returns a copy with country-aware formatting replaced.
      Parameters:
      value - new formatting settings
      Returns:
      immutable settings
    • 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.
    • locale

      public LocaleSettings locale()
      Returns the value of the locale record component.
      Returns:
      the value of the locale record component
    • metadata

      public DocumentMetadata metadata()
      Returns the value of the metadata record component.
      Returns:
      the value of the metadata record component
    • direction

      public TextDirection direction()
      Returns the value of the direction record component.
      Returns:
      the value of the direction record component
    • fallbackFonts

      public List<String> fallbackFonts()
      Returns the value of the fallbackFonts record component.
      Returns:
      the value of the fallbackFonts record component
    • hyphenate

      public Boolean hyphenate()
      Returns the value of the hyphenate record component.
      Returns:
      the value of the hyphenate record component