Module com.slinky.hackmaster
Package com.slinky.hackmaster.model.cell
Class Cell.IllegalCharAddition
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.IllegalArgumentException
com.slinky.hackmaster.model.cell.Cell.IllegalCharAddition
- All Implemented Interfaces:
Serializable
- Enclosing interface:
- Cell
The
IllegalCharAddition class is a specific type of
IllegalArgumentException that is thrown when an invalid character
is added to a cell. This exception indicates that the character being
added does not meet the required criteria for the cell.
This class provides constructors to create an exception with a specific
message, a cause, or both. It is designed to be used within the context
of the Cell interface to enforce character validation rules.
Note to students: This is an inner class, which means it is
defined within the Cell interface. An inner class is used here to
logically group the exception with the interface it is related to. This
helps keep the code organised and makes it clear that this exception is
specifically related to operations involving Cell objects.
- Since:
- 2024-07-05
- Version:
- 1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newIllegalCharAdditionwith the specified detail message.IllegalCharAddition(String message, Throwable cause) Constructs a newIllegalCharAdditionwith the specified detail message and cause.IllegalCharAddition(Throwable cause) Constructs a newIllegalCharAdditionwith the specified cause. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
IllegalCharAddition
Constructs a newIllegalCharAdditionwith the specified detail message.- Parameters:
s- the detail message explaining the reason for the exception.
-
IllegalCharAddition
Constructs a newIllegalCharAdditionwith the specified detail message and cause.- Parameters:
message- the detail message explaining the reason for the exception.cause- the cause of the exception.
-
IllegalCharAddition
Constructs a newIllegalCharAdditionwith the specified cause.- Parameters:
cause- the cause of the exception.
-