View Javadoc
1   package org.imageconverter.infra.exception;
2   
3   /**
4    * Element not found on search.
5    * 
6    * @author Fernando Romulo da Silva
7    */
8   public class ElementNotFoundException extends BaseApplicationException {
9   
10      private static final long serialVersionUID = 1L;
11  
12      /**
13       * Constructs a new ElementNotFoundException exception and create detail message regard of parameters. </br>
14       * For instance for Person object and msg equals to "id '10' and name 'Fernando'": </br>
15       * "Person with id '10' and name 'Fernando' not found"
16       * 
17       * @param <T> The class type
18       * @param cls Class element
19       * @param msg The specific message
20       */
21      public <T> ElementNotFoundException(final Class<T> cls, final String msg) {
22  	super("{exception.elementNotFound}", new Object[] { cls.getSimpleName(), msg });
23      }
24  
25      /**
26       * Constructs a new BaseApplicationException exception with the specified detail message.
27       * 
28       * @param msg    The detail message
29       * @param params The parameters used on message
30       */
31      protected ElementNotFoundException(final String msg, final Object... params) {
32  	super(msg, params);
33      }
34  }