Record Class GroupBlock

java.lang.Object
java.lang.Record
com.nsdev.lettergenerator.model.block.GroupBlock
Record Components:
blocks - child blocks, snapshotted while preserving nulls for field-path validation
style - nullable appearance and pagination overrides
defaultStyle - nullable typography fallback below theme and explicit overrides
All Implemented Interfaces:
Block

public record GroupBlock(List<Block> blocks, Style style, Style defaultStyle) extends Record implements Block
Ordered content grouped under common typography and a soft page-keep preference. An explicit keepTogether style overrides that preference. Group spacing applies around the container; pagination controls remain local. Explicit AUTO groups in body flow may contain page breaks.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GroupBlock(List<Block> blocks, Style style)
    Creates an ordinary group without fallback typography.
    GroupBlock(List<Block> blocks, Style style, Style defaultStyle)
    Snapshots the child list without checking its content or renderability.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the blocks record component.
    Returns the value of the defaultStyle record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    static GroupBlock
    of(Block... blocks)
    Creates a group using inherited appearance and the ordinary soft keep.
    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

    • GroupBlock

      public GroupBlock(List<Block> blocks, Style style)
      Creates an ordinary group without fallback typography.
      Parameters:
      blocks - ordered children
      style - optional explicit overrides
    • GroupBlock

      public GroupBlock(List<Block> blocks, Style style, Style defaultStyle)
      Snapshots the child list without checking its content or renderability.
      Parameters:
      blocks - child blocks, or null for generation-time validation
      style - nullable group overrides
      defaultStyle - optional fallback typography
  • Method Details

    • of

      public static GroupBlock of(Block... blocks)
      Creates a group using inherited appearance and the ordinary soft keep.
      Parameters:
      blocks - ordered child blocks
      Returns:
      immutable group
    • 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.
    • blocks

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

      public Style style()
      Returns the value of the style record component.
      Specified by:
      style in interface Block
      Returns:
      the value of the style record component
    • defaultStyle

      public Style defaultStyle()
      Returns the value of the defaultStyle record component.
      Returns:
      the value of the defaultStyle record component