Record Class AddressLayout

java.lang.Object
java.lang.Record
com.nsdev.lettergenerator.letter.AddressLayout
Record Components:
sender - sender rectangle, or null to keep sender in ordinary flow
recipient - recipient rectangle, or null to keep recipient in ordinary flow
date - date rectangle, or null to keep date in ordinary flow
heightMm - panel height in millimeters

public record AddressLayout(Bounds sender, Bounds recipient, Bounds date, double heightMm) extends Record
Optional freely positioned sender, recipient and date panel inside body flow. Bounds are relative to the panel, not the physical paper; validation uses actual page width.
  • Constructor Summary

    Constructors
    Constructor
    Description
    AddressLayout(Bounds sender, Bounds recipient, Bounds date, double heightMm)
    Creates an instance of a AddressLayout record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the date record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the heightMm record component.
    Returns the value of the recipient record component.
    Returns the value of the sender record component.
    final String
    Returns a string representation of this record class.
    Supplies an editable example window-envelope arrangement without postal compliance claims.

    Methods inherited from class java.lang.Object

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

    • AddressLayout

      public AddressLayout(Bounds sender, Bounds recipient, Bounds date, double heightMm)
      Creates an instance of a AddressLayout record class.
      Parameters:
      sender - the value for the sender record component
      recipient - the value for the recipient record component
      date - the value for the date record component
      heightMm - the value for the heightMm record component
  • Method Details

    • windowEnvelope

      public static AddressLayout windowEnvelope()
      Supplies an editable example window-envelope arrangement without postal compliance claims.
      Returns:
      a sender/recipient/date panel for ordinary A4 letter margins
    • 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.
    • sender

      public Bounds sender()
      Returns the value of the sender record component.
      Returns:
      the value of the sender record component
    • recipient

      public Bounds recipient()
      Returns the value of the recipient record component.
      Returns:
      the value of the recipient record component
    • date

      public Bounds date()
      Returns the value of the date record component.
      Returns:
      the value of the date record component
    • heightMm

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