From b8a53610ab1f0a4a19661d9193055b0eadf214b2 Mon Sep 17 00:00:00 2001 From: GregZ_ Date: Fri, 23 Jun 2017 17:13:36 +0100 Subject: [PATCH] Quests - V2.8.6-03 - Added InvalidStageException javadoc - By GregZ_ * Incremented dev version in pom.xml. * Added javadoc comments to the InvalidStageException class. * Added a package-info file for the me.blackvein.quests.exceptions package. --- pom.xml | 2 +- .../exceptions/InvalidStageException.java | 52 ++++++++++++++++--- .../quests/exceptions/package-info.java | 5 ++ 3 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 src/main/javadoc/me/blackvein/quests/exceptions/package-info.java diff --git a/pom.xml b/pom.xml index 9760fc86a..d1cec68a3 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ me.blackvein.quests quests - 2.8.6-02 + 2.8.6-03 quests https://github.com/FlyingPikachu/Quests/ jar diff --git a/src/main/java/me/blackvein/quests/exceptions/InvalidStageException.java b/src/main/java/me/blackvein/quests/exceptions/InvalidStageException.java index 350fe0c16..a7cd78276 100644 --- a/src/main/java/me/blackvein/quests/exceptions/InvalidStageException.java +++ b/src/main/java/me/blackvein/quests/exceptions/InvalidStageException.java @@ -2,28 +2,66 @@ package me.blackvein.quests.exceptions; import me.blackvein.quests.Quest; +/** + * This is the InvalidStageException class, this exception is used to indicate + * that the new stage of a quest does not exist. This is currently used in the + * Quest class when advancing to the next stage or manually setting the stage. + * + * @author Zino + * @author Blackvein + * @since 1.7.1-SNAPSHOT + * @version 3 + * @see Quest#nextStage(me.blackvein.quests.Quester) + * @see Quest#setStage(me.blackvein.quests.Quester, int) + */ public class InvalidStageException extends Exception { + /** + * The version id to use when serialising and deserialising this class. + */ + private static final long serialVersionUID = 1778748295752972651L; + + + /** + * The Quest instance that an invalid stage was set within. + */ private final Quest quest; + + /** + * The invalid stage number that was attempted to be set. + */ private final int stage; + /** + * Create a new instance of the InvalidStageException class with the given + * holding Quest and invalid stage number. + * + * @param quest + * The quest that an invalid stage id was set within. + * @param stage + * The invalid stage id that was set. + */ public InvalidStageException(Quest quest, int stage) { this.quest = quest; this.stage = stage; } + /** + * Get the quest instance associated with this exception. + * + * @return The quest that an invalid stage id was set within. + */ public Quest getQuest() { return quest; } + /** + * Get the invalid stage id that was attempted to be set within the quest + * class. + * + * @return The invalid stage id that was set. + */ public int getStage() { return stage; } - - private static final long serialVersionUID = 1778748295752972651L; - - @Override - public void printStackTrace() { - super.printStackTrace(); - } } diff --git a/src/main/javadoc/me/blackvein/quests/exceptions/package-info.java b/src/main/javadoc/me/blackvein/quests/exceptions/package-info.java new file mode 100644 index 000000000..766a9c599 --- /dev/null +++ b/src/main/javadoc/me/blackvein/quests/exceptions/package-info.java @@ -0,0 +1,5 @@ +/** + * Contains all the custom classes extending exception that are used within the + * Quests plugin. + */ +package me.blackvein.quests.exceptions; \ No newline at end of file