View Javadoc
1   package de.aikiit.bilanzanalyser.reader;
2   
3   public record BilanzRowParserStatistic(int error, int entries, int count) {
4       /**
5        * Derive a statistic object from the given result.
6        *
7        * @param result parsing result.
8        * @return statistic extract.
9        */
10      public static BilanzRowParserStatistic from(BilanzRowParserResult result) {
11          return new BilanzRowParserStatistic(result.errorCount(), result.rows().size(), result.rowCount());
12      }
13  
14      /**
15       * Determine whether the statistic is empty or not.
16       * @return {@code true} if the statistic does not contain any entries.
17       */
18      public boolean isEmpty() {
19          return error == 0 && entries == 0 && count == 0;
20      }
21  }