Record Class Stationery

java.lang.Object
java.lang.Record
com.nsdev.lettergenerator.theme.Stationery
Record Components:
elements - fixed top/bottom elements, defensively snapshotted
topZoneMm - reserved top height including the desired body gap
bottomZoneMm - reserved bottom height including the desired body gap

public record Stationery(List<FixedElement> elements, double topZoneMm, double bottomZoneMm) extends Record
Immutable header, footer and logo geometry shared by letters using a theme. Geometry is relative to the inner page rectangle; choose the same paper and margins when authoring the stationery. Letter-local regions with the same stable identifier replace inherited regions.
  • Constructor Details

    • Stationery

      public Stationery(List<FixedElement> elements, double topZoneMm, double bottomZoneMm)
      Snapshots registrations without validating geometry.
      Parameters:
      elements - nullable fixed registrations
      topZoneMm - reserved top zone
      bottomZoneMm - reserved bottom zone
  • Method Details

    • builder

      public static StationeryBuilder builder()
      Returns:
      independent convenience builder using ordinary letter defaults
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • elements

      public List<FixedElement> elements()
      Returns the value of the elements record component.
      Returns:
      the value of the elements record component
    • topZoneMm

      public double topZoneMm()
      Returns the value of the topZoneMm record component.
      Returns:
      the value of the topZoneMm record component
    • bottomZoneMm

      public double bottomZoneMm()
      Returns the value of the bottomZoneMm record component.
      Returns:
      the value of the bottomZoneMm record component