Package org.kigalisim.lang.validation
Class DuplicateValidationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.kigalisim.lang.validation.DuplicateValidationException
- All Implemented Interfaces:
Serializable
Exception thrown when duplicate names are detected during program validation.
This exception provides structured information about the type of duplicate detected, the duplicate name, and the context where the duplication occurred.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDuplicateValidationException(String duplicateType, String duplicateName, String context) Create a new duplicate validation exception.DuplicateValidationException(String duplicateType, String duplicateName, String context, String message) Create a new duplicate validation exception with a custom message. -
Method Summary
Modifier and TypeMethodDescriptionGet the context where the duplication occurred.Get the name that is duplicated.Get the type of item that is duplicated.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
DuplicateValidationException
Create a new duplicate validation exception.- Parameters:
duplicateType- The type of item that is duplicated (e.g., "scenario", "application")duplicateName- The name that is duplicatedcontext- The context where the duplication occurred (e.g., "program", "policy 'default'")
-
DuplicateValidationException
public DuplicateValidationException(String duplicateType, String duplicateName, String context, String message) Create a new duplicate validation exception with a custom message.- Parameters:
duplicateType- The type of item that is duplicatedduplicateName- The name that is duplicatedcontext- The context where the duplication occurredmessage- Custom error message
-
-
Method Details
-
getDuplicateType
Get the type of item that is duplicated.- Returns:
- The duplicate type (e.g., "scenario", "application")
-
getDuplicateName
Get the name that is duplicated.- Returns:
- The duplicate name
-
getContext
Get the context where the duplication occurred.- Returns:
- The context (e.g., "program", "policy 'default'")
-