Class ElementAlreadyExistsException

All Implemented Interfaces:
Serializable

public class ElementAlreadyExistsException extends ElementConflictException
Element already exists exception.
Author:
Fernando Romulo da Silva
See Also:
  • Constructor Details

    • ElementAlreadyExistsException

      public ElementAlreadyExistsException(Class<T> cls, Object id)
      Constructs a new ElementAlreadyExistsException exception and create detail message regard of parameters.
      For instance for Person object with id 10:
      "Person with id '10' already exists"
      Type Parameters:
      T - The class type
      Parameters:
      cls - Class element
      id - Object id that repeated
    • ElementAlreadyExistsException

      public ElementAlreadyExistsException(Class<T> cls, Object[] params)
      Constructs a new ElementAlreadyExistsException exception and create detail message regard of parameters.
      The exception detail msg will be: cls.getSimpleName() + " with " + msg + " already exists".
      For instance for Person object and msg equals to "id '10' and name 'Fernando'":
      "Person with id '10' and name 'Fernando' already exists"
      Type Parameters:
      T - The class type
      Parameters:
      cls - Class element
      msg - The specific message