Record Class Text

java.lang.Object
java.lang.Record
io.leandev.appfuse.report.node.Text
Record Components:
content - 文字內容
style - 文字樣式覆寫;null 表示沿用所在段落
All Implemented Interfaces:
Inline

public record Text(String content, TextStyle style) extends Record implements Inline
文字
Since:
4.0.0
  • Constructor Details

    • Text

      public Text(String content, TextStyle style)
      Creates an instance of a Text record class.
      Parameters:
      content - the value for the content record component
      style - the value for the style record component
  • Method Details

    • of

      public static Text of(String content)
      沿用段落樣式的文字
      Parameters:
      content - 文字內容
      Returns:
      文字節點
    • of

      public static Text of(String content, TextStyle style)
      帶樣式覆寫的文字
      Parameters:
      content - 文字內容
      style - 樣式覆寫
      Returns:
      文字節點
    • bold

      public static Text bold(String content)
      粗體文字
      Parameters:
      content - 文字內容
      Returns:
      文字節點
    • 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.
    • content

      public String content()
      Returns the value of the content record component.
      Returns:
      the value of the content record component
    • style

      public TextStyle style()
      Returns the value of the style record component.
      Returns:
      the value of the style record component