Record Class PageSize

java.lang.Object
java.lang.Record
org.xhtmlrenderer.css.parser.property.PageSize

public record PageSize(CSSPrimitiveValue width, CSSPrimitiveValue height) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final PageSize
    ISO A3 media: 297mm wide and 420mm high
    static final PageSize
    IS0 A4 media: 210 mm wide and 297 mm high
    static final PageSize
    ISO A5 media: 148mm wide and 210 mm high
    static final PageSize
    ISO B3 media: 176mm wide by 250mm high
    static final PageSize
    ISO B4 media: 250mm wide by 353mm high
    static final PageSize
    ISO B5 media: 176mm wide by 250 high
    static final PageSize
    North American ledger: 11 inches wide by 17 inches high
    static final PageSize
    North American legal: 8.5 inches wide by 14 inches high
    static final PageSize
    North American letter media: 8.5 inches wide and 11 inches high
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of a PageSize record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    static @Nullable PageSize
    getPageSize(String pageSize)
     
    final int
    Returns a hash code value for this object.
    Returns the value of the height record component.
    final String
    Returns a string representation of this record class.
    Returns the value of the width record component.

    Methods inherited from class java.lang.Object

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

    • A5

      public static final PageSize A5
      ISO A5 media: 148mm wide and 210 mm high
    • A4

      public static final PageSize A4
      IS0 A4 media: 210 mm wide and 297 mm high
    • A3

      public static final PageSize A3
      ISO A3 media: 297mm wide and 420mm high
    • B3

      public static final PageSize B3
      ISO B3 media: 176mm wide by 250mm high
    • B4

      public static final PageSize B4
      ISO B4 media: 250mm wide by 353mm high
    • B5

      public static final PageSize B5
      ISO B5 media: 176mm wide by 250 high
    • LETTER

      public static final PageSize LETTER
      North American letter media: 8.5 inches wide and 11 inches high
    • LEDGER

      public static final PageSize LEDGER
      North American ledger: 11 inches wide by 17 inches high
  • Constructor Details

    • PageSize

      public PageSize(CSSPrimitiveValue width, CSSPrimitiveValue height)
      Creates an instance of a PageSize record class.
      Parameters:
      width - the value for the width record component
      height - the value for the height record component
  • Method Details

    • getPageSize

      public static @Nullable PageSize getPageSize(String pageSize)
    • 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.
    • width

      public CSSPrimitiveValue width()
      Returns the value of the width record component.
      Returns:
      the value of the width record component
    • height

      public CSSPrimitiveValue height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component