-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow any string-like type to be a map key
- Loading branch information
Showing
2 changed files
with
71 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/io/github/kale_ko/bjsl/processor/exception/NotAPrimitiveException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.github.kale_ko.bjsl.processor.exception; | ||
|
||
import io.github.kale_ko.bjsl.elements.ParsedElement; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
/** | ||
* Thrown when a value is attempted to be used as a map key but is not a string or other string-able primitive. | ||
* | ||
* @version 2.0.0 | ||
* @since 2.0.0 | ||
*/ | ||
public class NotAPrimitiveException extends RuntimeException { | ||
/** | ||
* Create a new NotAPrimitiveException | ||
* | ||
* @param parsedObject The parsed object that was invalid | ||
*/ | ||
public NotAPrimitiveException(@NotNull ParsedElement parsedObject) { | ||
super("ParedElement is not a string or other string-able primitive, must be to be a map key!\n" + parsedObject); | ||
} | ||
} |