View Javadoc
1   package fr.inrae.agroclim.indicators.exception;
2   
3   import fr.inrae.agroclim.indicators.resources.I18n;
4   
5   /**
6    * A category for error types.
7    *
8    * Last change $Date$
9    *
10   * @author omaury
11   * @author $Author$
12   * @version $Revision$
13   */
14  public interface ErrorCategory {
15      /**
16       * @param i18n localized messages
17       * @return category description for the category code in I18n
18       */
19      default String getCategory(final I18n i18n) {
20          return i18n.get("error.category." + getName().toLowerCase());
21      }
22  
23      /**
24       * @return category code: prefix for {@link ErrorType#getFullCode()}.
25       */
26      String getCode();
27  
28      /**
29       * @return short name, formatted as enum name.
30       */
31      String getName();
32  
33  }