Record Class TsvEntity<T>

java.lang.Object
java.lang.Record
net.tangly.gleam.model.TsvEntity<T>
Type Parameters:
T - class of the entity
Record Components:
clazz - class of the entity
fields - fields of the entity with the mapping rules
imports - import factory function to create a new instance of the class with values of the CSV record
exports - export factory method to create a CSV record for an instance of the clas

public record TsvEntity<T>(Class<T> clazz, List<TsvProperty<T,?>> fields, Function<org.apache.commons.csv.CSVRecord,T> imports, BiConsumer<T,org.apache.commons.csv.CSVPrinter> exports) extends Record
Defines an entity mapped to a row of TSV values written to a TSV file.

A special case is if the entity is owned through one to multiple relation. The reference to the owner is stored in the TSV file. The extraction process returns a tuple with the the entity and the identifier of the owner.