Record Class Section

java.lang.Object
java.lang.Record
com.nsdev.lettergenerator.model.Section
Record Components:
name - section label; generation requires nonblank XML-compatible text
style - optional section overrides, or null to inherit the document style
blocks - body content; null is preserved for generation-time validation

public record Section(String name, Style style, List<Block> blocks) extends Record
Named group of body blocks rendered in list order. Sections do not force page breaks or select physical page regions; the name is a descriptive label. Style properties inherit from the document and are overridden by individual blocks and text runs.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Section(String name, Style style, List<Block> blocks)
    Snapshots the block list without validating the section or its content.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the blocks record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the name record component.
    Returns the value of the style record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Section

      public Section(String name, Style style, List<Block> blocks)
      Snapshots the block list without validating the section or its content. Null lists and null entries are retained for generation-time diagnostics.
      Parameters:
      name - descriptive label
      style - optional inherited-style overrides
      blocks - blocks to copy into an unmodifiable list, or null
  • Method Details

    • 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.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • style

      public Style style()
      Returns the value of the style record component.
      Returns:
      the value of the style record component
    • blocks

      public List<Block> blocks()
      Returns the value of the blocks record component.
      Returns:
      the value of the blocks record component