Record Class Padding

java.lang.Object
java.lang.Record
com.nsdev.lettergenerator.model.table.Padding
Record Components:
topMm - space inside the top edge
rightMm - space inside the right edge
bottomMm - space inside the bottom edge
leftMm - space inside the left edge

public record Padding(double topMm, double rightMm, double bottomMm, double leftMm) extends Record
Cell inner spacing, in millimeters. Each value must be finite and nonnegative at generation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Padding
    Legacy one-millimeter padding on each edge.
    static final Padding
    Explicit zero padding on each edge.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Padding(double topMm, double rightMm, double bottomMm, double leftMm)
    Creates an instance of a Padding record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the value of the bottomMm 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 leftMm record component.
    double
    Returns the value of the rightMm record component.
    double
    Returns the value of the topMm record component.
    final String
    Returns a string representation of this record class.
    static Padding
    uniform(double millimeters)
    Creates equal padding on all edges, deferring range checks to generation.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • DEFAULT

      public static final Padding DEFAULT
      Legacy one-millimeter padding on each edge.
    • ZERO

      public static final Padding ZERO
      Explicit zero padding on each edge.
  • Constructor Details

    • Padding

      public Padding(double topMm, double rightMm, double bottomMm, double leftMm)
      Creates an instance of a Padding record class.
      Parameters:
      topMm - the value for the topMm record component
      rightMm - the value for the rightMm record component
      bottomMm - the value for the bottomMm record component
      leftMm - the value for the leftMm record component
  • Method Details

    • uniform

      public static Padding uniform(double millimeters)
      Creates equal padding on all edges, deferring range checks to generation.
      Parameters:
      millimeters - uniform inner spacing
      Returns:
      immutable four-edge padding
    • 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 '=='.
      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.
    • topMm

      public double topMm()
      Returns the value of the topMm record component.
      Returns:
      the value of the topMm record component
    • rightMm

      public double rightMm()
      Returns the value of the rightMm record component.
      Returns:
      the value of the rightMm record component
    • bottomMm

      public double bottomMm()
      Returns the value of the bottomMm record component.
      Returns:
      the value of the bottomMm record component
    • leftMm

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