Record Class DocumentStyles
java.lang.Object
java.lang.Record
io.leandev.appfuse.report.node.DocumentStyles
- Record Components:
text- 內文文字樣式paragraph- 段落樣式headings- 標題層級(1–4)對段落樣式的覆寫table- 表格樣式box- 區塊框樣式
public record DocumentStyles(TextStyle text, ParagraphStyle paragraph, Map<Integer, ParagraphStyle> headings, TableStyle table, BoxStyle box)
extends Record
文件層級的完整樣式,是所有覆寫值的合併基底
text()、paragraph()、table()、box() 的每個欄位都必須有值(paragraph.text 與 table.text
可為 null,代表沿用 text());headings() 是疊在段落樣式上的各層級覆寫。
一般以 standard() 為基準,透過 builder() 或 ReportDocument.Builder#styles 覆寫需要的欄位。
- Since:
- 4.0.0
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDocumentStyles(TextStyle text, ParagraphStyle paragraph, Map<Integer, ParagraphStyle> headings, TableStyle table, BoxStyle box) Creates an instance of aDocumentStylesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbox()Returns the value of theboxrecord component.static DocumentStyles.Builderbuilder()以standard()為基準的建構器final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.headings()Returns the value of theheadingsrecord component.Returns the value of theparagraphrecord component.static DocumentStylesstandard()框架基準樣式table()Returns the value of thetablerecord component.text()Returns the value of thetextrecord component.以本樣式為基準的建構器final StringtoString()Returns a string representation of this record class.with(Consumer<DocumentStyles.Builder> customizer) 以本樣式為基準,套用覆寫後產生新樣式
-
Constructor Details
-
DocumentStyles
public DocumentStyles(TextStyle text, ParagraphStyle paragraph, Map<Integer, ParagraphStyle> headings, TableStyle table, BoxStyle box) Creates an instance of aDocumentStylesrecord class.
-
-
Method Details
-
standard
-
builder
-
toBuilder
-
with
以本樣式為基準,套用覆寫後產生新樣式- Parameters:
customizer- 覆寫設定- Returns:
- 新樣式
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
text
-
paragraph
-
headings
-
table
-
box
-