From da0bed3b5e9c1b0b8c679af576789e595372e71d Mon Sep 17 00:00:00 2001 From: "main()" Date: Sat, 31 Dec 2011 20:49:17 +0100 Subject: [PATCH] Added missing javadoc in the configuration-package. --- .../configuration/BooleanConfigProperty.java | 3 + .../configuration/ColorConfigProperty.java | 3 + .../configuration/ConfigPropertyFactory.java | 136 ++++++++++++++++++ .../DifficultyConfigProperty.java | 3 + .../configuration/DoubleConfigProperty.java | 3 + .../configuration/GameModeConfigProperty.java | 3 + .../configuration/IntegerConfigProperty.java | 3 + .../configuration/LocationConfigProperty.java | 3 + .../configuration/MVConfigProperty.java | 11 ++ .../configuration/StringConfigProperty.java | 3 + 10 files changed, 171 insertions(+) diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/BooleanConfigProperty.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/BooleanConfigProperty.java index 498faea2..85c33605 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/BooleanConfigProperty.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/BooleanConfigProperty.java @@ -9,6 +9,9 @@ package com.onarandombox.MultiverseCore.configuration; import org.bukkit.configuration.ConfigurationSection; +/** + * A {@link Boolean} config-property. + */ public class BooleanConfigProperty implements MVConfigProperty { private String name; private Boolean value; diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/ColorConfigProperty.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/ColorConfigProperty.java index 7ba3c551..e4230a1d 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/ColorConfigProperty.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/ColorConfigProperty.java @@ -10,6 +10,9 @@ package com.onarandombox.MultiverseCore.configuration; import com.onarandombox.MultiverseCore.enums.EnglishChatColor; import org.bukkit.configuration.ConfigurationSection; +/** + * A {@link EnglishChatColor} config-property. + */ public class ColorConfigProperty implements MVConfigProperty { private String name; private EnglishChatColor value; diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/ConfigPropertyFactory.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/ConfigPropertyFactory.java index 3a526ccb..2b70ec77 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/ConfigPropertyFactory.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/ConfigPropertyFactory.java @@ -22,73 +22,209 @@ public class ConfigPropertyFactory { } // Booleans + /** + * Constructs a new ConfigProperty. + * + * @param name The name of this ConfigProperty. + * @param defaultValue The default-value. + * @param help The text that's displayed when a user failed to set the property. + * @return The ConfigProperty. + */ public BooleanConfigProperty getNewProperty(String name, boolean defaultValue, String help) { return new BooleanConfigProperty(this.section, name, defaultValue, help); } + /** + * Constructs a new ConfigProperty. + * + * @param name The name of this ConfigProperty. + * @param defaultValue The default-value. + * @param node The name of the configuration-node this ConfigProperty will be stored as. + * @param help The text that's displayed when a user failed to set the property. + * @return The ConfigProperty. + */ public BooleanConfigProperty getNewProperty(String name, boolean defaultValue, String node, String help) { return new BooleanConfigProperty(this.section, name, defaultValue, node, help); } // Integers + /** + * Constructs a new ConfigProperty. + * + * @param name The name of this ConfigProperty. + * @param defaultValue The default-value. + * @param help The text that's displayed when a user failed to set the property. + * @return The ConfigProperty. + */ public IntegerConfigProperty getNewProperty(String name, int defaultValue, String help) { return new IntegerConfigProperty(this.section, name, defaultValue, help); } + /** + * Constructs a new ConfigProperty. + * + * @param name The name of this ConfigProperty. + * @param defaultValue The default-value. + * @param node The name of the configuration-node this ConfigProperty will be stored as. + * @param help The text that's displayed when a user failed to set the property. + * @return The ConfigProperty. + */ public IntegerConfigProperty getNewProperty(String name, int defaultValue, String node, String help) { return new IntegerConfigProperty(this.section, name, defaultValue, node, help); } // Doubles + /** + * Constructs a new ConfigProperty. + * + * @param name The name of this ConfigProperty. + * @param defaultValue The default-value. + * @param help The text that's displayed when a user failed to set the property. + * @return The ConfigProperty. + */ public DoubleConfigProperty getNewProperty(String name, double defaultValue, String help) { return new DoubleConfigProperty(this.section, name, defaultValue, help); } + /** + * Constructs a new ConfigProperty. + * + * @param name The name of this ConfigProperty. + * @param defaultValue The default-value. + * @param node The name of the configuration-node this ConfigProperty will be stored as. + * @param help The text that's displayed when a user failed to set the property. + * @return The ConfigProperty. + */ public DoubleConfigProperty getNewProperty(String name, double defaultValue, String node, String help) { return new DoubleConfigProperty(this.section, name, defaultValue, node, help); } // Strings + /** + * Constructs a new ConfigProperty. + * + * @param name The name of this ConfigProperty. + * @param defaultValue The default-value. + * @param help The text that's displayed when a user failed to set the property. + * @return The ConfigProperty. + */ public StringConfigProperty getNewProperty(String name, String defaultValue, String help) { return new StringConfigProperty(this.section, name, defaultValue, help); } + /** + * Constructs a new ConfigProperty. + * + * @param name The name of this ConfigProperty. + * @param defaultValue The default-value. + * @param node The name of the configuration-node this ConfigProperty will be stored as. + * @param help The text that's displayed when a user failed to set the property. + * @return The ConfigProperty. + */ public StringConfigProperty getNewProperty(String name, String defaultValue, String node, String help) { return new StringConfigProperty(this.section, name, defaultValue, node, help); } // Colors + /** + * Constructs a new ConfigProperty. + * + * @param name The name of this ConfigProperty. + * @param defaultValue The default-value. + * @param help The text that's displayed when a user failed to set the property. + * @return The ConfigProperty. + */ public ColorConfigProperty getNewProperty(String name, EnglishChatColor defaultValue, String help) { return new ColorConfigProperty(this.section, name, defaultValue, help); } + /** + * Constructs a new ConfigProperty. + * + * @param name The name of this ConfigProperty. + * @param defaultValue The default-value. + * @param node The name of the configuration-node this ConfigProperty will be stored as. + * @param help The text that's displayed when a user failed to set the property. + * @return The ConfigProperty. + */ public ColorConfigProperty getNewProperty(String name, EnglishChatColor defaultValue, String node, String help) { return new ColorConfigProperty(this.section, name, defaultValue, node, help); } // Difficulty + /** + * Constructs a new ConfigProperty. + * + * @param name The name of this ConfigProperty. + * @param defaultValue The default-value. + * @param help The text that's displayed when a user failed to set the property. + * @return The ConfigProperty. + */ public DifficultyConfigProperty getNewProperty(String name, Difficulty defaultValue, String help) { return new DifficultyConfigProperty(this.section, name, defaultValue, help); } + /** + * Constructs a new ConfigProperty. + * + * @param name The name of this ConfigProperty. + * @param defaultValue The default-value. + * @param node The name of the configuration-node this ConfigProperty will be stored as. + * @param help The text that's displayed when a user failed to set the property. + * @return The ConfigProperty. + */ public DifficultyConfigProperty getNewProperty(String name, Difficulty defaultValue, String node, String help) { return new DifficultyConfigProperty(this.section, name, defaultValue, node, help); } // GameMode + /** + * Constructs a new ConfigProperty. + * + * @param name The name of this ConfigProperty. + * @param defaultValue The default-value. + * @param help The text that's displayed when a user failed to set the property. + * @return The ConfigProperty. + */ public GameModeConfigProperty getNewProperty(String name, GameMode defaultValue, String help) { return new GameModeConfigProperty(this.section, name, defaultValue, help); } + /** + * Constructs a new ConfigProperty. + * + * @param name The name of this ConfigProperty. + * @param defaultValue The default-value. + * @param node The name of the configuration-node this ConfigProperty will be stored as. + * @param help The text that's displayed when a user failed to set the property. + * @return The ConfigProperty. + */ public GameModeConfigProperty getNewProperty(String name, GameMode defaultValue, String node, String help) { return new GameModeConfigProperty(this.section, name, defaultValue, node, help); } // GameMode + /** + * Constructs a new ConfigProperty. + * + * @param name The name of this ConfigProperty. + * @param defaultValue The default-value. + * @param help The text that's displayed when a user failed to set the property. + * @return The ConfigProperty. + */ public LocationConfigProperty getNewProperty(String name, Location defaultValue, String help) { return new LocationConfigProperty(this.section, name, defaultValue, help); } + /** + * Constructs a new ConfigProperty. + * + * @param name The name of this ConfigProperty. + * @param defaultValue The default-value. + * @param node The name of the configuration-node this ConfigProperty will be stored as. + * @param help The text that's displayed when a user failed to set the property. + * @return The ConfigProperty. + */ public LocationConfigProperty getNewProperty(String name, Location defaultValue, String node, String help) { return new LocationConfigProperty(this.section, name, defaultValue, node, help); } diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/DifficultyConfigProperty.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/DifficultyConfigProperty.java index 8b0097c7..9116f751 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/DifficultyConfigProperty.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/DifficultyConfigProperty.java @@ -10,6 +10,9 @@ package com.onarandombox.MultiverseCore.configuration; import org.bukkit.Difficulty; import org.bukkit.configuration.ConfigurationSection; +/** + * A {@link Difficulty} config-property. + */ public class DifficultyConfigProperty implements MVConfigProperty { private String name; private Difficulty value; diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/DoubleConfigProperty.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/DoubleConfigProperty.java index 0cfb0122..e1740900 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/DoubleConfigProperty.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/DoubleConfigProperty.java @@ -9,6 +9,9 @@ package com.onarandombox.MultiverseCore.configuration; import org.bukkit.configuration.ConfigurationSection; +/** + * A {@link Double} config-property. + */ public class DoubleConfigProperty implements MVConfigProperty { private String name; private Double value; diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/GameModeConfigProperty.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/GameModeConfigProperty.java index 976c1a88..2edf8e9d 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/GameModeConfigProperty.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/GameModeConfigProperty.java @@ -10,6 +10,9 @@ package com.onarandombox.MultiverseCore.configuration; import org.bukkit.GameMode; import org.bukkit.configuration.ConfigurationSection; +/** + * A {@link GameMode} config-property. + */ public class GameModeConfigProperty implements MVConfigProperty { private String name; private GameMode value; diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/IntegerConfigProperty.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/IntegerConfigProperty.java index af5b3b0a..aaf136ef 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/IntegerConfigProperty.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/IntegerConfigProperty.java @@ -9,6 +9,9 @@ package com.onarandombox.MultiverseCore.configuration; import org.bukkit.configuration.ConfigurationSection; +/** + * A {@link Integer} config-property. + */ public class IntegerConfigProperty implements MVConfigProperty { private String name; private Integer value; diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/LocationConfigProperty.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/LocationConfigProperty.java index ef886e64..3833dc18 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/LocationConfigProperty.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/LocationConfigProperty.java @@ -11,6 +11,9 @@ import com.onarandombox.MultiverseCore.utils.LocationManipulation; import org.bukkit.Location; import org.bukkit.configuration.ConfigurationSection; +/** + * A {@link Location} config-property. + */ public class LocationConfigProperty implements MVConfigProperty { private String name; private Location value; diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/MVConfigProperty.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/MVConfigProperty.java index 9aacb546..ccb5924d 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/MVConfigProperty.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/MVConfigProperty.java @@ -7,6 +7,11 @@ package com.onarandombox.MultiverseCore.configuration; +/** + * A generic config-property. + * + * @param The type of the config-property. + */ public interface MVConfigProperty { /** * Gets the name of this property. @@ -40,6 +45,7 @@ public interface MVConfigProperty { * Sets the value of this property. * * @param value The T representation of this value. + * @return True the value was successfully set. */ boolean setValue(T value); @@ -52,5 +58,10 @@ public interface MVConfigProperty { */ boolean parseValue(String value); + /** + * Gets the name of the config-node that this {@link MVConfigProperty} is saved as. + * + * @return The name of the config-node that this {@link MVConfigProperty} is saved as. + */ String getConfigNode(); } diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/StringConfigProperty.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/StringConfigProperty.java index 29e13665..b2e67ea9 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/StringConfigProperty.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/StringConfigProperty.java @@ -9,6 +9,9 @@ package com.onarandombox.MultiverseCore.configuration; import org.bukkit.configuration.ConfigurationSection; +/** + * A {@link String} config-property. + */ public class StringConfigProperty implements MVConfigProperty { private String name; private String value;