Package io.github.mrtyldr.datev.plain
Class DatevFile.Builder
java.lang.Object
io.github.mrtyldr.datev.plain.DatevFile.Builder
- Enclosing class:
- DatevFile
Configures a fixed-schema file, including the optional EXTF management record.
The static factories cover the common cases; this builder exists so schema, validator and metadata can be combined without a factory per combination. Instances are not thread-safe.
-
Method Details
-
validator
Sets the optional row validator.- Parameters:
validator- receives the format version and each immutable aligned row- Returns:
- this builder
-
metadata
Sets the EXTF management record written before the heading.The metadata's format version must match this builder's schema, so a complete file cannot silently declare a version it does not contain.
- Parameters:
metadata- the management record- Returns:
- this builder
- Throws:
IllegalArgumentException- if the metadata's format version differs from the schema
-
build
Creates the configured file.- Returns:
- a new file
-