View Javadoc
1   /*
2    * CSVeed (https://github.com/42BV/CSVeed)
3    *
4    * Copyright 2013-2023 CSVeed.
5    *
6    * All rights reserved. This program and the accompanying materials
7    * are made available under the terms of The Apache Software License,
8    * Version 2.0 which accompanies this distribution, and is available at
9    * https://www.apache.org/licenses/LICENSE-2.0.txt
10   */
11  package org.csveed.report;
12  
13  import java.util.ArrayList;
14  import java.util.List;
15  
16  /**
17   * The Class AbstractCsvError.
18   */
19  public abstract class AbstractCsvError implements CsvError {
20  
21      /** The message. */
22      private String message;
23  
24      /**
25       * Instantiates a new abstract csv error.
26       *
27       * @param message
28       *            the message
29       */
30      protected AbstractCsvError(String message) {
31          this.message = message;
32      }
33  
34      @Override
35      public String getMessage() {
36          return this.message;
37      }
38  
39      /**
40       * Gets the message as list.
41       *
42       * @return the message as list
43       */
44      protected List<String> getMessageAsList() {
45          List<String> lines = new ArrayList<>();
46          lines.add(getMessage());
47          return lines;
48      }
49  
50  }