Record Class Image

java.lang.Object
java.lang.Record
io.leandev.appfuse.report.node.Image
Record Components:
id - 選填識別
data - 圖片資料
width - 選填寬度
height - 選填高度
altText - 替代文字(必填)
caption - 選填圖說
All Implemented Interfaces:
Block

public record Image(String id, ImageData data, Length width, Length height, String altText, List<Inline> caption) extends Record implements Block

點陣圖片;與圖說保持同頁

寬高皆可省略:只給一邊時等比縮放,都省略時由 renderer 依圖片本身尺寸與可用寬度決定。

Since:
4.0.0
  • Constructor Details

    • Image

      public Image(String id, ImageData data, Length width, Length height, String altText, List<Inline> caption)
      Creates an instance of a Image record class.
      Parameters:
      id - the value for the id record component
      data - the value for the data record component
      width - the value for the width record component
      height - the value for the height record component
      altText - the value for the altText record component
      caption - the value for the caption record component
  • 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
    • data

      public ImageData data()
      Returns the value of the data record component.
      Returns:
      the value of the data record component
    • width

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

      public Length height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component
    • altText

      public String altText()
      Returns the value of the altText record component.
      Returns:
      the value of the altText record component
    • caption

      public List<Inline> caption()
      Returns the value of the caption record component.
      Returns:
      the value of the caption record component