Files
Matrix/src/main/java/com/mattrixwv/matrix/exceptions/InvalidGeometryException.java
2026-01-26 15:01:23 -05:00

63 lines
2.6 KiB
Java

package com.mattrixwv.matrix.exceptions;
/**
* Exception thrown to indicate that a geometry-related error has occurred.
*
* @author Mattrixwv
*/
public class InvalidGeometryException extends RuntimeException{
/**
* Constructs a new {@code InvalidGeometryException} with {@code null} as its detail message.
* The cause is not initialized and may subsequently be initialized by a call to {@link #initCause}.
*/
public InvalidGeometryException(){
super();
}
/**
* Constructs a new {@code InvalidGeometryException} with the specified detail message.
* The cause is not initialized and may subsequently be initialized by a call to {@link #initCause}.
*
* @param message the detail message, which is saved for later retrieval by the {@link #getMessage()} method.
*/
public InvalidGeometryException(String message){
super(message);
}
/**
* Constructs a new {@code InvalidGeometryException} with the specified cause and a detail message of
* {@code (cause==null ? null : cause.toString())} (which typically contains the class and detail message
* of {@code cause}). This constructor is useful for exceptions that are wrappers for other exceptions.
*
* @param throwable the cause (which is saved for later retrieval by the {@link #getCause()} method).
* (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
public InvalidGeometryException(Throwable throwable){
super(throwable);
}
/**
* Constructs a new {@code InvalidGeometryException} with the specified detail message and cause.
*
* @param message the detail message, which is saved for later retrieval by the {@link #getMessage()} method.
* @param throwable the cause (which is saved for later retrieval by the {@link #getCause()} method).
* (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
public InvalidGeometryException(String message, Throwable throwable){
super(message, throwable);
}
/**
* Constructs a new {@code InvalidGeometryException} with a default message indicating an invalid number
* of elements provided. The message is constructed using the given number of elements and the expected
* number of elements.
*
* @param givenElements the number of elements that were provided and deemed invalid.
* @param neededElements the expected or required number of elements.
*/
public InvalidGeometryException(int givenElements, int neededElements){
super("Invalid number of elements " + givenElements + " must be " + neededElements);
}
}