From 1923c457a44f6fd8f77502f457d3155a8a3b542d Mon Sep 17 00:00:00 2001 From: Eric Date: Sat, 21 Mar 2020 15:37:19 +0100 Subject: [PATCH] Fix javadoc --- .../main/java/de/epiceric/shopchest/api/ShopManager.java | 5 ++--- .../epiceric/shopchest/api/event/ShopSelectItemEvent.java | 2 +- .../main/java/de/epiceric/shopchest/api/shop/Shop.java | 5 ++--- .../java/de/epiceric/shopchest/database/Database.java | 2 ++ .../main/java/de/epiceric/shopchest/shop/ShopImpl.java | 6 +++--- .../src/main/java/de/epiceric/shopchest/util/Counter.java | 8 ++++++++ .../src/main/java/de/epiceric/shopchest/util/NmsUtil.java | 2 ++ 7 files changed, 20 insertions(+), 10 deletions(-) diff --git a/api/src/main/java/de/epiceric/shopchest/api/ShopManager.java b/api/src/main/java/de/epiceric/shopchest/api/ShopManager.java index 56272c6..b1492f3 100644 --- a/api/src/main/java/de/epiceric/shopchest/api/ShopManager.java +++ b/api/src/main/java/de/epiceric/shopchest/api/ShopManager.java @@ -3,7 +3,6 @@ package de.epiceric.shopchest.api; import java.util.Collection; import java.util.Optional; import java.util.concurrent.CompletableFuture; -import java.util.function.Consumer; import org.bukkit.Location; import org.bukkit.OfflinePlayer; @@ -80,7 +79,7 @@ public interface ShopManager { * @param sellPrice the price a player can sell the product for. * @return a completable future returning the new shop * @since 1.13 - * @see ShopManager#addAdminShop(ShopProduct, Location, double, double, Consumer, Consumer) + * @see ShopManager#addAdminShop(ShopProduct, Location, double, double) */ CompletableFuture addShop(OfflinePlayer vendor, ShopProduct product, Location location, double buyPrice, double sellPrice); @@ -98,7 +97,7 @@ public interface ShopManager { * @param sellPrice the price a player can sell the product for. * @return a completable future returning the new shop * @since 1.13 - * @see ShopManager#addShop(OfflinePlayer, ShopProduct, Location, double, double, Consumer, Consumer) + * @see ShopManager#addShop(OfflinePlayer, ShopProduct, Location, double, double) */ CompletableFuture addAdminShop(ShopProduct product, Location location, double buyPrice, double sellPrice); diff --git a/api/src/main/java/de/epiceric/shopchest/api/event/ShopSelectItemEvent.java b/api/src/main/java/de/epiceric/shopchest/api/event/ShopSelectItemEvent.java index c7e379e..85040b5 100644 --- a/api/src/main/java/de/epiceric/shopchest/api/event/ShopSelectItemEvent.java +++ b/api/src/main/java/de/epiceric/shopchest/api/event/ShopSelectItemEvent.java @@ -140,7 +140,7 @@ public class ShopSelectItemEvent extends Event implements Cancellable { * Gets either the shop type of the shop being created, or whether the shop * is being edited * - * @return the shop type or {@link Type#EDIT} + * @return the shop type or {@link SelectFlag.Type#EDIT} */ public SelectFlag.Type getType() { return type; diff --git a/api/src/main/java/de/epiceric/shopchest/api/shop/Shop.java b/api/src/main/java/de/epiceric/shopchest/api/shop/Shop.java index 87650c0..6db28d7 100644 --- a/api/src/main/java/de/epiceric/shopchest/api/shop/Shop.java +++ b/api/src/main/java/de/epiceric/shopchest/api/shop/Shop.java @@ -1,7 +1,6 @@ package de.epiceric.shopchest.api.shop; import java.util.Optional; -import java.util.function.Consumer; import org.bukkit.Location; import org.bukkit.OfflinePlayer; @@ -15,8 +14,8 @@ import de.epiceric.shopchest.api.exceptions.ChestNotFoundException; * Represents a shop * * @since 1.13 - * @see ShopManager#addShop(OfflinePlayer, ShopProduct, Location, double, double, Consumer, Consumer) - * @see ShopManager#addAdminShop(ShopProduct, Location, double, double, Consumer, Consumer) + * @see ShopManager#addShop(OfflinePlayer, ShopProduct, Location, double, double) + * @see ShopManager#addAdminShop(ShopProduct, Location, double, double) */ public interface Shop { diff --git a/core/src/main/java/de/epiceric/shopchest/database/Database.java b/core/src/main/java/de/epiceric/shopchest/database/Database.java index 2d08450..fce03d5 100644 --- a/core/src/main/java/de/epiceric/shopchest/database/Database.java +++ b/core/src/main/java/de/epiceric/shopchest/database/Database.java @@ -799,6 +799,8 @@ public abstract class Database { /** * Gets whether the database has been fully initialized + * + * @return whether the database is initialized */ public boolean isInitialized() { return initialized; diff --git a/core/src/main/java/de/epiceric/shopchest/shop/ShopImpl.java b/core/src/main/java/de/epiceric/shopchest/shop/ShopImpl.java index b06a0cf..6ec7a78 100644 --- a/core/src/main/java/de/epiceric/shopchest/shop/ShopImpl.java +++ b/core/src/main/java/de/epiceric/shopchest/shop/ShopImpl.java @@ -145,7 +145,7 @@ public class ShopImpl implements Shop { * To update the shop in the database, it is necessary to update the shop in the database. * * @param product the product - * @see Database#updateShop(Shop, Runnable, java.util.function.Consumer) + * @see Database#updateShop(Shop) */ public void setProduct(ShopProduct product) { this.product = product; @@ -189,7 +189,7 @@ public class ShopImpl implements Shop { * * @param buyPrice the buy price * @throws IllegalStateException when a player can neither buy nor sell from this shop - * @see Database#updateShop(Shop, Runnable, java.util.function.Consumer) + * @see Database#updateShop(Shop) * @since 1.13 */ public void setBuyPrice(double buyPrice) { @@ -213,7 +213,7 @@ public class ShopImpl implements Shop { * * @param sellPrice the sell price * @throws IllegalStateException when a player can neither buy nor sell from this shop - * @see Database#updateShop(Shop, Runnable, java.util.function.Consumer) + * @see Database#updateShop(Shop) * @since 1.13 */ public void setSellPrice(double sellPrice) { diff --git a/core/src/main/java/de/epiceric/shopchest/util/Counter.java b/core/src/main/java/de/epiceric/shopchest/util/Counter.java index e0aacd8..ef73f3b 100644 --- a/core/src/main/java/de/epiceric/shopchest/util/Counter.java +++ b/core/src/main/java/de/epiceric/shopchest/util/Counter.java @@ -23,6 +23,8 @@ public final class Counter { /** * Increments the counter by one and returns itself + * + * @return this counter */ public final Counter increment() { this.value++; @@ -31,6 +33,8 @@ public final class Counter { /** * Decrements the counter by one if its value is greater than zero and returns itself + * + * @return this counter */ public final Counter decrement() { this.value = Math.max(0, this.value - 1); @@ -39,7 +43,9 @@ public final class Counter { /** * Sets the counter's value to the given value or zero if the given value is negative + * * @param value the value to set the counter to + * @return this counter */ public final Counter set(int value) { this.value = Math.max(0, value); @@ -48,6 +54,8 @@ public final class Counter { /** * Returns the current value + * + * @return the current value */ public final int get() { return value; diff --git a/core/src/main/java/de/epiceric/shopchest/util/NmsUtil.java b/core/src/main/java/de/epiceric/shopchest/util/NmsUtil.java index b0dac16..69ce2ca 100644 --- a/core/src/main/java/de/epiceric/shopchest/util/NmsUtil.java +++ b/core/src/main/java/de/epiceric/shopchest/util/NmsUtil.java @@ -38,6 +38,8 @@ public class NmsUtil { * Gets the major version of the server *

* (e.g. 9 for v1_9_R2, 10 for v1_10_R1) + * + * @return the major version */ public static int getMajorVersion() { return Integer.parseInt(getServerVersion().split("_")[1]);