Record Class FixedElement

java.lang.Object
java.lang.Record
com.nsdev.lettergenerator.model.layout.FixedElement
Record Components:
id - document-unique label used to identify the element
zone - reserved page region containing the element
pages - pages on which to repeat this content
boundsMm - rectangle relative to the zone's upper-left corner, in millimeters
blocks - ordered region content; null is preserved for validation

public record FixedElement(String id, Zone zone, PageSelector pages, Bounds boundsMm, List<Block> blocks) extends Record
Positioned content repeated on selected pages inside a reserved top or bottom zone. Unlike body sections, fixed content cannot flow onto another page. Its bounds are relative to the selected zone, not the physical page or body origin.

Generation requires unique nonblank identifiers, nonempty blocks, and bounds fitting the zone. Elements in the same zone may touch but must not overlap on any selected page. Page-break blocks are invalid here. Construction only snapshots the list.

  • Constructor Details

    • FixedElement

      public FixedElement(String id, Zone zone, PageSelector pages, Bounds boundsMm, List<Block> blocks)
      Snapshots content into an unmodifiable list while retaining null lists and entries. Geometry and content are validated when the document is generated.
      Parameters:
      id - element identifier
      zone - containing region
      pages - page selection
      boundsMm - zone-relative rectangle in millimeters
      blocks - content to copy, 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.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • zone

      public Zone zone()
      Returns the value of the zone record component.
      Returns:
      the value of the zone record component
    • pages

      public PageSelector pages()
      Returns the value of the pages record component.
      Returns:
      the value of the pages record component
    • boundsMm

      public Bounds boundsMm()
      Returns the value of the boundsMm record component.
      Returns:
      the value of the boundsMm record component
    • blocks

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