Skip to content

Commit

Permalink
fix: add missing tags and cleanup JavaDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMrMilchmann committed Jan 8, 2020
1 parent c43d157 commit 1e9cd7f
Showing 1 changed file with 33 additions and 5 deletions.
38 changes: 33 additions & 5 deletions src/main/java/com/github/gw2toolbelt/gw2ml/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public final class Configuration<T> {
* <p style="font-family: monospace">
* Property: <b>com.github.gw2toolbelt.gw2ml.librarypath</b><br>
* &nbsp; &nbsp;Usage: Dynamic<br>
*
* @since 0.1.0
*/
public static final Configuration<String> LIBRARY_PATH = new Configuration<>(
"com.github.gw2toolbelt.gw2ml.librarypath",
Expand All @@ -77,6 +79,8 @@ public final class Configuration<T> {
* Property: <b>com.github.gw2toolbelt.gw2ml.bundledLibrary.nameMapper</b><br>
* &nbsp; &nbsp; Type: String or a {@link Function Function&lt;String, String&gt;} instance<br>
* &nbsp; &nbsp;Usage: Static</p>
*
* @since 0.1.0
*/
public static final Configuration<Object> BUNDLED_LIBRARY_NAME_MAPPER = new Configuration<>(
"com.github.gw2toolbelt.gw2ml.bundledLibrary.nameMapper",
Expand All @@ -99,6 +103,8 @@ public final class Configuration<T> {
* Property: <b>com.github.gw2toolbelt.gw2ml.bundledLibrary.nameMapper</b><br>
* &nbsp; &nbsp; Type: String or a {@link Function Function&lt;String, String&gt;} instance<br>
* &nbsp; &nbsp;Usage: Static</p>
*
* @since 0.1.0
*/
public static final Configuration<Object> BUNDLED_LIBRARY_PATH_MAPPER = new Configuration<>(
"com.github.gw2toolbelt.gw2ml.bundledLibrary.pathMapper",
Expand All @@ -113,6 +119,8 @@ public final class Configuration<T> {
* <p style="font-family: monospace">
* Property: <b>com.github.gw2toolbelt.gw2ml.SharedLibraryExtractDirectory</b><br>
* &nbsp; &nbsp;Usage: Dynamic<br>
*
* @since 0.1.0
*/
public static final Configuration<String> SHARED_LIBRARY_EXTRACT_DIRECTORY = new Configuration<>(
"com.github.gw2toolbelt.gw2ml.SharedLibraryExtractDirectory",
Expand Down Expand Up @@ -141,6 +149,8 @@ public final class Configuration<T> {
* <p style="font-family: monospace">
* Property: <b>com.github.gw2toolbelt.gw2ml.SharedLibraryExtractPath</b><br>
* &nbsp; &nbsp;Usage: Dynamic</p>
*
* @since 0.1.0
*/
public static final Configuration<String> SHARED_LIBRARY_EXTRACT_PATH = new Configuration<>(
"com.github.gw2toolbelt.gw2ml.SharedLibraryExtractPath",
Expand All @@ -154,6 +164,8 @@ public final class Configuration<T> {
* <p style="font-family: monospace">
* Property: <b>com.github.gw2toolbelt.gw2ml.libname</b><br>
* &nbsp; &nbsp;Usage: Dynamic</p>
*
* @since 0.1.0
*/
public static final Configuration<String> LIBRARY_NAME = new Configuration<>(
"com.github.gw2toolbelt.gw2ml.libname",
Expand All @@ -168,6 +180,8 @@ public final class Configuration<T> {
* <p style="font-family: monospace">
* Property: <b>com.github.gw2toolbelt.gw2ml.util.Debug</b><br>
* &nbsp; &nbsp;Usage: Static</p>
*
* @since 0.1.0
*/
public static final Configuration<Boolean> DEBUG = new Configuration<>(
"com.github.gw2toolbelt.gw2ml.util.Debug",
Expand All @@ -183,6 +197,8 @@ public final class Configuration<T> {
* <p style="font-family: monospace">
* Property: <b>com.github.gw2toolbelt.gw2ml.util.DebugLoader</b><br>
* &nbsp; &nbsp;Usage: Static</p>
*
* @since 0.1.0
*/
public static final Configuration<Boolean> DEBUG_LOADER = new Configuration<>(
"com.github.gw2toolbelt.gw2ml.util.DebugLoader",
Expand All @@ -201,6 +217,8 @@ public final class Configuration<T> {
* Property: <b>com.github.gw2toolbelt.gw2ml.util.DebugStream</b><br>
* &nbsp; &nbsp; Type: String or a {@link PrintStream} instance<br>
* &nbsp; &nbsp;Usage: Static</p>
*
* @since 0.1.0
*/
public static final Configuration<Object> DEBUG_STREAM = new Configuration<>(
"com.github.gw2toolbelt.gw2ml.util.DebugStream",
Expand All @@ -215,6 +233,8 @@ public final class Configuration<T> {
* <p style="font-family: monospace">
* Property: <b>com.github.gw2toolbelt.gw2ml.util.NoChecks</b><br>
* &nbsp; &nbsp;Usage: Static</p>
*
* @since 0.1.0
*/
public static final Configuration<Boolean> DISABLE_CHECKS = new Configuration<>(
"com.github.gw2toolbelt.gw2ml.util.NoChecks",
Expand Down Expand Up @@ -255,6 +275,8 @@ private Configuration(String property, StateInit<? extends T> init, Usage usage)
* Returns the property key.
*
* @return the property key
*
* @since 0.1.0
*/
String getProperty() {
return property;
Expand All @@ -264,16 +286,20 @@ String getProperty() {
* Sets the option value.
*
* @param value the value to set
*
* @since 0.1.0
*/
public void set(@Nullable T value) {
if (this.isFrozen) throw new IllegalStateException("Property is statically used.");
this.state = value;
}

/**
* Returns the option value.
* Returns the value of this option, or {@code null} if no value has been set.
*
* @return the value of this option, or {@code null} if no value has been set
*
* <p>If the option value has not been set, null will be returned.</p>
* @since 0.1.0
*/
@Nullable
public T get() {
Expand All @@ -282,11 +308,13 @@ public T get() {
}

/**
* Returns the option value.
* Returns the value of this option, or {@code defaultValue} if no value has been set.
*
* @param defaultValue the default value
*
* <p>If the option value has not been set, the specified default value will be returned.</p>
* @return the value of this option, or {@code defaultValue} if no value has been set
*
* @param defaultValue the default value
* @since 0.1.0
*/
public T get(T defaultValue) {
if (this.usage == Usage.STATIC) this.isFrozen = true;
Expand Down

0 comments on commit 1e9cd7f

Please sign in to comment.