Class CsvDocument.Builder
java.lang.Object
cloud.opencode.base.csv.CsvDocument.Builder
- Enclosing class:
CsvDocument
Builder for CsvDocument
CsvDocument构建器
Provides a fluent API for constructing CsvDocument instances.
提供用于构建CsvDocument实例的流式API。
- Since:
- JDK 25, opencode-base-csv V1.0.3
- Author:
- Leon Soo
-
Method Summary
Modifier and TypeMethodDescriptionAdds an existing CsvRow 添加现有的CsvRowAdds a row from field values 从字段值添加行build()Builds the CsvDocument 构建CsvDocumentSets the header names 设置标题名称Sets the header names from a list 从列表设置标题名称
-
Method Details
-
header
Sets the header names 设置标题名称- Parameters:
headers- the header names | 标题名称- Returns:
- this builder | 此构建器
-
header
Sets the header names from a list 从列表设置标题名称- Parameters:
headers- the header names | 标题名称- Returns:
- this builder | 此构建器
-
addRow
Adds a row from field values 从字段值添加行- Parameters:
fields- the field values | 字段值- Returns:
- this builder | 此构建器
-
addRow
Adds an existing CsvRow 添加现有的CsvRow- Parameters:
row- the row to add | 要添加的行- Returns:
- this builder | 此构建器
- Throws:
NullPointerException- if row is null | 如果row为null
-
build
Builds the CsvDocument 构建CsvDocument- Returns:
- the CsvDocument instance | CsvDocument实例
-