Package io.github.dornol.excelkit.core
Record Class ExcelKitSchema.SchemaColumn<T>
java.lang.Object
java.lang.Record
io.github.dornol.excelkit.core.ExcelKitSchema.SchemaColumn<T>
- Type Parameters:
T- The row data type- Record Components:
name- Column header namewriteFunction- Function to extract the cell value from a row objectreadSetter- BiConsumer to set the cell value into a row objectwriteConfigurer- Optional consumer to configure Excel column properties (type, format, etc.)
- Enclosing class:
ExcelKitSchema<T>
public static record ExcelKitSchema.SchemaColumn<T>(String name, Function<T,@Nullable Object> writeFunction, BiConsumer<T,CellData> readSetter, @Nullable Consumer<ExcelColumn.ExcelColumnBuilder<T>> writeConfigurer)
extends Record
Represents a single column definition in the schema.
-
Constructor Summary
ConstructorsConstructorDescriptionSchemaColumn(String name, Function<T, @Nullable Object> writeFunction, BiConsumer<T, CellData> readSetter) Creates a schema column without write configuration.SchemaColumn(String name, Function<T, @Nullable Object> writeFunction, BiConsumer<T, CellData> readSetter, @Nullable Consumer<ExcelColumn.ExcelColumnBuilder<T>> writeConfigurer) Creates an instance of aSchemaColumnrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.Returns the value of thereadSetterrecord component.final StringtoString()Returns a string representation of this record class.@Nullable Consumer<ExcelColumn.ExcelColumnBuilder<T>> Returns the value of thewriteConfigurerrecord component.Returns the value of thewriteFunctionrecord component.
-
Constructor Details
-
SchemaColumn
public SchemaColumn(String name, Function<T, @Nullable Object> writeFunction, BiConsumer<T, CellData> readSetter) Creates a schema column without write configuration.- Parameters:
name- the column header namewriteFunction- function to extract the cell valuereadSetter- consumer to set the cell value
-
SchemaColumn
public SchemaColumn(String name, Function<T, @Nullable Object> writeFunction, BiConsumer<T, CellData> readSetter, @Nullable Consumer<ExcelColumn.ExcelColumnBuilder<T>> writeConfigurer) Creates an instance of aSchemaColumnrecord class.- Parameters:
name- the value for thenamerecord componentwriteFunction- the value for thewriteFunctionrecord componentreadSetter- the value for thereadSetterrecord componentwriteConfigurer- the value for thewriteConfigurerrecord component
-
-
Method Details
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
writeFunction
Returns the value of thewriteFunctionrecord component.- Returns:
- the value of the
writeFunctionrecord component
-
readSetter
Returns the value of thereadSetterrecord component.- Returns:
- the value of the
readSetterrecord component
-
writeConfigurer
Returns the value of thewriteConfigurerrecord component.- Returns:
- the value of the
writeConfigurerrecord component
-