Package io.keikai.axyra.sheets
Record Class ImportOptions
java.lang.Object
java.lang.Record
io.keikai.axyra.sheets.ImportOptions
- Record Components:
columns- property names to include, in output order;nullimports every discovered propertyheaders- whether to write a header row above the data (defaulttrueviadefaults()/builder())columnLabels- display names for the header row, one per included column;nulluses the property names themselvesheaderStyle- theCellStyleapplied to the header row, ornullfor no styling
public record ImportOptions(String[] columns, boolean headers, String[] columnLabels, CellStyle headerStyle)
extends Record
Options for
Sheet.importData(int, int, java.util.List, ImportOptions) —
data import that maps a collection of Java objects
(records, JavaBeans, or plain-field classes) onto a range of cells.
All fields are optional; defaults() enables a header row and
imports every discovered property in its natural order. Build a customized
instance with builder():
ImportOptions opts = ImportOptions.builder()
.columns("name", "salary") // subset + order
.columnLabels("Employee", "Salary") // header display names
.headerStyle(CellStyle.builder().bold().build())
.build();
int rows = sheet.importData(0, 0, employees, opts);
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionImportOptions(String[] columns, boolean headers, String[] columnLabels, CellStyle headerStyle) Creates an instance of aImportOptionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImportOptions.Builderbuilder()A fresh builder pre-loaded with the defaults (headers = true).String[]Returns the value of thecolumnLabelsrecord component.String[]columns()Returns the value of thecolumnsrecord component.static ImportOptionsdefaults()Default options: header row enabled, all properties, no labels or styling.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanheaders()Returns the value of theheadersrecord component.Returns the value of theheaderStylerecord component.A builder pre-loaded with this value, for read–modify–write round-trips.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ImportOptions
public ImportOptions(String[] columns, boolean headers, String[] columnLabels, CellStyle headerStyle) Creates an instance of aImportOptionsrecord class.- Parameters:
columns- the value for thecolumnsrecord componentheaders- the value for theheadersrecord componentcolumnLabels- the value for thecolumnLabelsrecord componentheaderStyle- the value for theheaderStylerecord component
-
-
Method Details
-
defaults
Default options: header row enabled, all properties, no labels or styling. -
builder
A fresh builder pre-loaded with the defaults (headers = true). -
toBuilder
A builder pre-loaded with this value, for read–modify–write round-trips. -
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. -
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. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
columns
Returns the value of thecolumnsrecord component.- Returns:
- the value of the
columnsrecord component
-
headers
public boolean headers()Returns the value of theheadersrecord component.- Returns:
- the value of the
headersrecord component
-
columnLabels
Returns the value of thecolumnLabelsrecord component.- Returns:
- the value of the
columnLabelsrecord component
-
headerStyle
Returns the value of theheaderStylerecord component.- Returns:
- the value of the
headerStylerecord component
-