java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
edu.ntnu.idatt2106_2023_06.backend.exception.exists.ExistsException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CategoryExistsException, FileAlreadyExistsException, UserExistsException

public class ExistsException extends RuntimeException
An exception that is thrown when an entity already exists in the system.
Author:
Brage Halvorsen Kvamme, Trym Hamer Gudvangen
See Also:
  • Constructor Details

    • ExistsException

      public ExistsException(String attribute, String value)
      This method constructs a new ExistsException with the given attribute and value.
      Parameters:
      attribute - The name of the attribute that already exists, given as a String
      value - The value of the attribute that already exists, given as a String
    • ExistsException

      public ExistsException(String attribute, Long value)
      This method constructs a new ExistsException with the given attribute and value.
      Parameters:
      attribute - The name of the attribute that already exists, given as a String
      value - The value of the attribute that already exists, given as a Long object
    • ExistsException

      public ExistsException(String type, String attribute, String value)
      This method constructs a new ExistsException with the given type, attribute, and value.
      Parameters:
      type - The type of the entity that already exists, given as a String
      attribute - The name of the attribute that already exists, given as a String
      value - The value of the attribute that already exists, given as a String