Record Class ImportOptions

java.lang.Object
java.lang.Record
io.keikai.axyra.sheets.ImportOptions
Record Components:
columns - property names to include, in output order; null imports every discovered property
headers - whether to write a header row above the data (default true via defaults() / builder())
columnLabels - display names for the header row, one per included column; null uses the property names themselves
headerStyle - the CellStyle applied to the header row, or null for 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);
 
  • Constructor Details

    • ImportOptions

      public ImportOptions(String[] columns, boolean headers, String[] columnLabels, CellStyle headerStyle)
      Creates an instance of a ImportOptions record class.
      Parameters:
      columns - the value for the columns record component
      headers - the value for the headers record component
      columnLabels - the value for the columnLabels record component
      headerStyle - the value for the headerStyle record component
  • Method Details

    • defaults

      public static ImportOptions defaults()
      Default options: header row enabled, all properties, no labels or styling.
    • builder

      public static ImportOptions.Builder builder()
      A fresh builder pre-loaded with the defaults (headers = true).
    • toBuilder

      public ImportOptions.Builder toBuilder()
      A builder pre-loaded with this value, for read–modify–write round-trips.
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • columns

      public String[] columns()
      Returns the value of the columns record component.
      Returns:
      the value of the columns record component
    • headers

      public boolean headers()
      Returns the value of the headers record component.
      Returns:
      the value of the headers record component
    • columnLabels

      public String[] columnLabels()
      Returns the value of the columnLabels record component.
      Returns:
      the value of the columnLabels record component
    • headerStyle

      public CellStyle headerStyle()
      Returns the value of the headerStyle record component.
      Returns:
      the value of the headerStyle record component