diff --git a/api/src/main/java/com/clubobsidian/dynamicgui/api/effect/ParticleWrapper.java b/api/src/main/java/com/clubobsidian/dynamicgui/api/effect/ParticleWrapper.java index 6fcc5aeeb..aca124ebc 100644 --- a/api/src/main/java/com/clubobsidian/dynamicgui/api/effect/ParticleWrapper.java +++ b/api/src/main/java/com/clubobsidian/dynamicgui/api/effect/ParticleWrapper.java @@ -42,10 +42,20 @@ public ParticleWrapper(@NotNull ParticleData data) { this.data = Objects.requireNonNull(data); } + /** + * Gets the ParticleData for the particle effect + * + * @return the ParticleData object + */ public ParticleData getData() { return this.data; } + /** + * Spawns the particle effect for the player + * + * @param player the player to spawn the effect for + */ public void spawnEffect(@NotNull PlayerWrapper player) { Objects.requireNonNull(player); player.playEffect(this.data); @@ -53,6 +63,11 @@ public void spawnEffect(@NotNull PlayerWrapper player) { public static class ParticleData { + /** + * Creates a ParticleData object from a string + * @param str the string to create the ParticleData object from + * @return + */ public static ParticleData fromString(@NotNull String str) { Objects.requireNonNull(str); if (str.contains(",")) { diff --git a/api/src/main/java/com/clubobsidian/dynamicgui/api/effect/SoundWrapper.java b/api/src/main/java/com/clubobsidian/dynamicgui/api/effect/SoundWrapper.java index b1c6e1baa..e910cb705 100644 --- a/api/src/main/java/com/clubobsidian/dynamicgui/api/effect/SoundWrapper.java +++ b/api/src/main/java/com/clubobsidian/dynamicgui/api/effect/SoundWrapper.java @@ -44,10 +44,20 @@ public SoundWrapper(@NotNull SoundData data) { this.data = Objects.requireNonNull(data); } + /** + * Gets the SoundData for the sound effect + * + * @return the SoundData object + */ public SoundData getData() { return this.data; } + /** + * Plays the sound to the player + * + * @param player the player to play the sound to + */ public void playSoundToPlayer(@NotNull PlayerWrapper player) { Objects.requireNonNull(player); player.playSound(this.data); @@ -55,6 +65,11 @@ public void playSoundToPlayer(@NotNull PlayerWrapper player) { public static class SoundData { + /** + * Creates a SoundData object from a string + * @param str The string to create the SoundData object from + * @return + */ public static SoundData fromString(@NotNull String str) { Objects.requireNonNull(str); if (str.contains(",")) { @@ -82,15 +97,29 @@ private SoundData(@NotNull String sound, float volume, float pitch) { this.volume = volume; this.pitch = pitch; } - + /** + * Gets the sound name + * + * @return the sound name + */ public String getSound() { return this.sound; } + /** + * Gets the volume of the sound + * + * @return the volume of the sound + */ public float getVolume() { return this.volume; } + /** + * Gets the pitch of the sound + * + * @return the pitch of the sound + */ public float getPitch() { return this.pitch; } diff --git a/api/src/main/java/com/clubobsidian/dynamicgui/api/enchantment/EnchantmentWrapper.java b/api/src/main/java/com/clubobsidian/dynamicgui/api/enchantment/EnchantmentWrapper.java index 34be5db5d..38085a759 100644 --- a/api/src/main/java/com/clubobsidian/dynamicgui/api/enchantment/EnchantmentWrapper.java +++ b/api/src/main/java/com/clubobsidian/dynamicgui/api/enchantment/EnchantmentWrapper.java @@ -44,14 +44,25 @@ public EnchantmentWrapper(@NotNull String enchant, int level) { this.level = level; } + /** + * Gets the enchantment + * @return String enchantment + */ public String getEnchant() { return this.enchant; } + /** + * Gets the level of the enchantment + * @return int level of the enchantment + */ public int getLevel() { return this.level; } + /** + * Static builder for the enchantment wrapper + */ public static class Builder { private transient String enchantment; diff --git a/api/src/main/java/com/clubobsidian/dynamicgui/api/entity/EntityWrapper.java b/api/src/main/java/com/clubobsidian/dynamicgui/api/entity/EntityWrapper.java index cbfd5eac0..a34dc0229 100644 --- a/api/src/main/java/com/clubobsidian/dynamicgui/api/entity/EntityWrapper.java +++ b/api/src/main/java/com/clubobsidian/dynamicgui/api/entity/EntityWrapper.java @@ -29,6 +29,10 @@ public EntityWrapper(@NotNull T entity) { this.entity = Objects.requireNonNull(entity); } + /** + * Get the UUID of the entity + * @return the UUID of the entity + */ public abstract UUID getUniqueId(); /** diff --git a/api/src/main/java/com/clubobsidian/dynamicgui/api/function/Function.java b/api/src/main/java/com/clubobsidian/dynamicgui/api/function/Function.java index 2e8711a2a..71b5b1a14 100644 --- a/api/src/main/java/com/clubobsidian/dynamicgui/api/function/Function.java +++ b/api/src/main/java/com/clubobsidian/dynamicgui/api/function/Function.java @@ -160,6 +160,11 @@ public Function clone() { } } + /** + * Checks if the function is equal to another object + * @param o + * @return true if the function is equal to another object + */ @Override public boolean equals(Object o) { if (this == o) return true; @@ -168,6 +173,10 @@ public boolean equals(Object o) { return async == function.async && name.equals(function.name) && aliases.equals(function.aliases); } + /** + * Gets the hashcode of the function + * @return the hashcode of the function + */ @Override public int hashCode() { return Objects.hash(name, async, aliases); diff --git a/api/src/main/java/com/clubobsidian/dynamicgui/api/plugin/DynamicGuiPlugin.java b/api/src/main/java/com/clubobsidian/dynamicgui/api/plugin/DynamicGuiPlugin.java index 3a90ceb34..3f64b70fe 100644 --- a/api/src/main/java/com/clubobsidian/dynamicgui/api/plugin/DynamicGuiPlugin.java +++ b/api/src/main/java/com/clubobsidian/dynamicgui/api/plugin/DynamicGuiPlugin.java @@ -52,14 +52,23 @@ default Permission getPermission() { File getDataFolder(); + /** + * @return the DynamicGUI config file + */ default File getConfigFile() { return new File(this.getDataFolder(), "config.yml"); } + /** + * @return the default gui folder + */ default File getGuiFolder() { return new File(this.getDataFolder(), "guis"); } + /** + * @return the default macro folder + */ default File getMacroFolder() { return new File(this.getDataFolder(), "macros"); } diff --git a/api/src/main/java/com/clubobsidian/dynamicgui/api/proxy/Proxy.java b/api/src/main/java/com/clubobsidian/dynamicgui/api/proxy/Proxy.java index 6db8ea19a..30cf3a4f1 100644 --- a/api/src/main/java/com/clubobsidian/dynamicgui/api/proxy/Proxy.java +++ b/api/src/main/java/com/clubobsidian/dynamicgui/api/proxy/Proxy.java @@ -37,6 +37,11 @@ public enum Proxy { this.aliases = aliases; } + /** + * Returns a proxy from its string alias + * @param proxyStr + * @return + */ public static Proxy fromString(final String proxyStr) { String localeStr = proxyStr.toLowerCase(Locale.ROOT); for (Proxy proxy : Proxy.values()) { @@ -49,11 +54,19 @@ public static Proxy fromString(final String proxyStr) { return Proxy.NONE; } + /** + * Gets the aliases of a proxy + * @return The aliases of the proxy + */ public String[] getAliases() { return this.aliases; } + /** + * Gets the protocol of the proxy + * @return The protocol of the proxy + */ public Protocol getProtocol() { return this.protocol; } diff --git a/api/src/main/java/com/clubobsidian/dynamicgui/api/replacer/Replacer.java b/api/src/main/java/com/clubobsidian/dynamicgui/api/replacer/Replacer.java index 52b7c9788..a83b67dfc 100644 --- a/api/src/main/java/com/clubobsidian/dynamicgui/api/replacer/Replacer.java +++ b/api/src/main/java/com/clubobsidian/dynamicgui/api/replacer/Replacer.java @@ -32,12 +32,28 @@ public Replacer(String toReplace, boolean listener) { this.listener = listener; } + /** + * Gets the string to replace + * + * @return The string to replace + */ public String getToReplace() { return this.toReplace; } + /** + * Replaces the toReplace string with the replacement + * @param text + * @param playerWrapper + * @return + */ public abstract String replacement(String text, PlayerWrapper playerWrapper); + /** + * Gets if the replacer has a listener + * + * @return If the replacer has a listener + */ public boolean hasListener() { return this.listener; } diff --git a/api/src/main/java/com/clubobsidian/dynamicgui/api/world/LocationWrapper.java b/api/src/main/java/com/clubobsidian/dynamicgui/api/world/LocationWrapper.java index 649095bac..e8e0a46cb 100644 --- a/api/src/main/java/com/clubobsidian/dynamicgui/api/world/LocationWrapper.java +++ b/api/src/main/java/com/clubobsidian/dynamicgui/api/world/LocationWrapper.java @@ -38,18 +38,38 @@ public LocationWrapper(int x, int y, int z, WorldWrapper world) { this.world = world; } + /** + * Gets the x coordinate of the location + * + * @return x coordinate of the location + */ public int getX() { return this.x; } + /** + * Gets the y coordinate of the location + * + * @return y coordinate of the location + */ public int getY() { return this.y; } + /** + * Gets the z coordinate of the location + * + * @return z coordinate of the location + */ public int getZ() { return this.z; } + /** + * Gets the WoldWrapper for the location + * + * @return wold of the location + */ public WorldWrapper getWorld() { return this.world; } diff --git a/api/src/main/java/com/clubobsidian/dynamicgui/api/world/WorldWrapper.java b/api/src/main/java/com/clubobsidian/dynamicgui/api/world/WorldWrapper.java index 62beaa90f..9485e8a39 100644 --- a/api/src/main/java/com/clubobsidian/dynamicgui/api/world/WorldWrapper.java +++ b/api/src/main/java/com/clubobsidian/dynamicgui/api/world/WorldWrapper.java @@ -31,14 +31,29 @@ public WorldWrapper(String name) { this.name = name; } + /** + * Gets the name of the world + * + * @return The name of the world + */ public String getName() { return this.name; } public abstract T getWorld(); + /** + * Sets the game rule of the world to the specified value + * @param key + * @param value + */ public abstract void setGameRule(String key, String value); + /** + * Gets value of the game rule for the world + * @param rule + * @return + */ public abstract String getGameRule(String rule); @Override diff --git a/core/src/main/java/com/clubobsidian/dynamicgui/core/command/CommandRegistrarImpl.java b/core/src/main/java/com/clubobsidian/dynamicgui/core/command/CommandRegistrarImpl.java index 798a43225..171db70ad 100644 --- a/core/src/main/java/com/clubobsidian/dynamicgui/core/command/CommandRegistrarImpl.java +++ b/core/src/main/java/com/clubobsidian/dynamicgui/core/command/CommandRegistrarImpl.java @@ -59,12 +59,24 @@ private CommandRegistrarImpl(CommandManager commandManager, this.commandManager.setSetting(CommandManager.ManagerSettings.OVERRIDE_EXISTING_COMMANDS, true); } + /** + * Registers a command to the command manager + * + * @param command The command to register + */ @Override public void registerCommand(@NotNull Class command) { Objects.requireNonNull(command); this.commandParser.parse(this.injector.getInstance(command)); } + /** + * Registers an alias for a GUI to the command manager + * + * @param guiName The name of the GUI to open + * @param alias The alias of the command to register + * @param arguments The arguments to register with the command + */ @Override public void registerGuiAliasCommand(@NotNull String guiName, @NotNull String alias, @@ -103,6 +115,12 @@ public void registerGuiAliasCommand(@NotNull String guiName, ); } + /** + * Unregisters a command from the command manager + * and removes it from the registered aliases list + * + * @param alias The alias to unregister + */ @Override public void unregisterCommand(@NotNull String alias) { Objects.requireNonNull(alias); @@ -114,6 +132,10 @@ public void unregisterCommand(@NotNull String alias) { this.registeredAliases.remove(alias); } + /** + * Unregisters all the aliases that were registered + * with the command registrar + */ @Override public void unregisterGuiAliases() { for (int i = 0; i < this.registeredAliases.size(); i++) { diff --git a/core/src/main/java/com/clubobsidian/dynamicgui/core/config/ChatColorTransformer.java b/core/src/main/java/com/clubobsidian/dynamicgui/core/config/ChatColorTransformer.java index 40310f15c..5389e26ff 100644 --- a/core/src/main/java/com/clubobsidian/dynamicgui/core/config/ChatColorTransformer.java +++ b/core/src/main/java/com/clubobsidian/dynamicgui/core/config/ChatColorTransformer.java @@ -25,6 +25,11 @@ public ChatColorTransformer() { super(String.class); } + /** + * Converts a string to a colorized string + * @param transform String to convert + * @return Colorized string + */ @Override public String transform(String transform) { return ChatColor.translateAlternateColorCodes(transform); diff --git a/core/src/main/java/com/clubobsidian/dynamicgui/core/event/InventoryEvent.java b/core/src/main/java/com/clubobsidian/dynamicgui/core/event/InventoryEvent.java index a83eb0fe8..7178fa9ff 100644 --- a/core/src/main/java/com/clubobsidian/dynamicgui/core/event/InventoryEvent.java +++ b/core/src/main/java/com/clubobsidian/dynamicgui/core/event/InventoryEvent.java @@ -28,6 +28,10 @@ public InventoryEvent(PlayerWrapper playerWrapper, InventoryWrapper invent this.inventoryWrapper = inventoryWrapper; } + /** + * Gets the inventory wrapper associated with this event + * @return The inventory wrapper associated with this event + */ public InventoryWrapper getInventoryWrapper() { return this.inventoryWrapper; } diff --git a/core/src/main/java/com/clubobsidian/dynamicgui/core/event/LocationEvent.java b/core/src/main/java/com/clubobsidian/dynamicgui/core/event/LocationEvent.java index 669d6e3b9..ecaff8039 100644 --- a/core/src/main/java/com/clubobsidian/dynamicgui/core/event/LocationEvent.java +++ b/core/src/main/java/com/clubobsidian/dynamicgui/core/event/LocationEvent.java @@ -28,6 +28,10 @@ public LocationEvent(PlayerWrapper playerWrapper, LocationWrapper location this.locationWrapper = locationWrapper; } + /** + * Gets the location wrapper associated with this event + * @return The location wrapper associated with this event + */ public LocationWrapper getLocationWrapper() { return this.locationWrapper; } diff --git a/core/src/main/java/com/clubobsidian/dynamicgui/core/event/PlayerEvent.java b/core/src/main/java/com/clubobsidian/dynamicgui/core/event/PlayerEvent.java index b7ef7a0df..3f31c778b 100644 --- a/core/src/main/java/com/clubobsidian/dynamicgui/core/event/PlayerEvent.java +++ b/core/src/main/java/com/clubobsidian/dynamicgui/core/event/PlayerEvent.java @@ -27,6 +27,10 @@ public PlayerEvent(PlayerWrapper playerWrapper) { this.playerWrapper = playerWrapper; } + /** + * Gets the player wrapper associated with this event + * @return The player wrapper associated with this event + */ public PlayerWrapper getPlayerWrapper() { return this.playerWrapper; } diff --git a/core/src/main/java/com/clubobsidian/dynamicgui/core/event/block/PlayerInteractEvent.java b/core/src/main/java/com/clubobsidian/dynamicgui/core/event/block/PlayerInteractEvent.java index de9804637..a11c894c7 100644 --- a/core/src/main/java/com/clubobsidian/dynamicgui/core/event/block/PlayerInteractEvent.java +++ b/core/src/main/java/com/clubobsidian/dynamicgui/core/event/block/PlayerInteractEvent.java @@ -34,10 +34,17 @@ public PlayerInteractEvent(PlayerWrapper playerWrapper, LocationWrapper lo this.canceled = false; } + /** + * Gets the action the player performed + * @return the PlayerAction the player performed + */ public PlayerAction getAction() { return this.action; } + /** + * @return true if the event is cancelled, false otherwise + */ @Override public boolean isCancelled() { return this.canceled; diff --git a/core/src/main/java/com/clubobsidian/dynamicgui/core/event/inventory/Click.java b/core/src/main/java/com/clubobsidian/dynamicgui/core/event/inventory/Click.java index 91efe371a..6dae87f4d 100644 --- a/core/src/main/java/com/clubobsidian/dynamicgui/core/event/inventory/Click.java +++ b/core/src/main/java/com/clubobsidian/dynamicgui/core/event/inventory/Click.java @@ -24,6 +24,10 @@ public enum Click { SHIFT_LEFT, SHIFT_RIGHT; + /** + * Checks if the click is a shift click + * @return True if the click is a shift click, false otherwise + */ public boolean isShift() { return this == Click.SHIFT_LEFT || this == Click.SHIFT_RIGHT; } diff --git a/core/src/main/java/com/clubobsidian/dynamicgui/core/event/inventory/GuiLoadEvent.java b/core/src/main/java/com/clubobsidian/dynamicgui/core/event/inventory/GuiLoadEvent.java index f697676fc..186363eb8 100644 --- a/core/src/main/java/com/clubobsidian/dynamicgui/core/event/inventory/GuiLoadEvent.java +++ b/core/src/main/java/com/clubobsidian/dynamicgui/core/event/inventory/GuiLoadEvent.java @@ -34,19 +34,34 @@ public GuiLoadEvent(Gui gui, PlayerWrapper playerWrapper) { this.cancelled = false; } + /** + * Gets the gui which was loaded + * @return The gui which associated with the load event + */ public Gui gui() { return this.gui; } + /** + * Get the player wrapper associated with this event + * @return The player wrapper associated with this event + */ public PlayerWrapper getPlayerWrapper() { return this.playerWrapper; } + /** + * @return True if the event is cancelled, false otherwise + */ @Override public boolean isCancelled() { return this.cancelled; } + /** + * Set the status of the event + * @param cancelled + */ @Override public void setCancelled(boolean cancelled) { this.cancelled = cancelled; diff --git a/core/src/main/java/com/clubobsidian/dynamicgui/core/event/inventory/PlayerInteractEntityEvent.java b/core/src/main/java/com/clubobsidian/dynamicgui/core/event/inventory/PlayerInteractEntityEvent.java index 8f8e883a1..24b578e79 100644 --- a/core/src/main/java/com/clubobsidian/dynamicgui/core/event/inventory/PlayerInteractEntityEvent.java +++ b/core/src/main/java/com/clubobsidian/dynamicgui/core/event/inventory/PlayerInteractEntityEvent.java @@ -29,6 +29,10 @@ public PlayerInteractEntityEvent(PlayerWrapper playerWrapper, EntityWrapper getEntityWrapper() { return this.entityWrapper; } diff --git a/core/src/main/java/com/clubobsidian/dynamicgui/core/event/player/PlayerAction.java b/core/src/main/java/com/clubobsidian/dynamicgui/core/event/player/PlayerAction.java index 0ab2f20b1..4c5c8d677 100644 --- a/core/src/main/java/com/clubobsidian/dynamicgui/core/event/player/PlayerAction.java +++ b/core/src/main/java/com/clubobsidian/dynamicgui/core/event/player/PlayerAction.java @@ -24,6 +24,10 @@ public enum PlayerAction { RIGHT_CLICK_BLOCK, PHYSICAL; + /** + * Checks if the player action is a block click + * @return True if the player action is a block click, false otherwise + */ public boolean isBlockClick() { return this == PlayerAction.RIGHT_CLICK_BLOCK || this == PlayerAction.LEFT_CLICK_BLOCK; } diff --git a/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/AfterDateLazyFunction.java b/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/AfterDateLazyFunction.java index 0eb8b0e74..9731418a0 100644 --- a/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/AfterDateLazyFunction.java +++ b/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/AfterDateLazyFunction.java @@ -31,6 +31,14 @@ @FunctionParameter(name = "AfterDate", isLazy = true) public class AfterDateLazyFunction extends AbstractFunction { + /** + * This function is used to check if the current date is after the date specified in the parameter. + * + * @param expression The expression + * @param functionToken The function token + * @param parameterValues The parameter values + * @return BigDecimal.ONE if the current date is after the date specified in the parameter, BigDecimal.ZERO otherwise + */ @Override public EvaluationValue evaluate(Expression expression, Token functionToken, EvaluationValue... parameterValues) { try { diff --git a/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/BeforeDateLazyFunction.java b/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/BeforeDateLazyFunction.java index fb8f54a76..2711cb7bc 100644 --- a/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/BeforeDateLazyFunction.java +++ b/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/BeforeDateLazyFunction.java @@ -32,6 +32,14 @@ @FunctionParameter(name = "BeforeDate", isLazy = true) public class BeforeDateLazyFunction extends AbstractFunction { + /** + * This function is used to check if the current date is before the date specified in the parameter. + * + * @param expression The expression + * @param functionToken The function token + * @param parameterValues The parameter values + * @return BigDecimal.ONE if the current date is before the date specified in the parameter, BigDecimal.ZERO otherwise + */ @Override public EvaluationValue evaluate(Expression expression, Token functionToken, EvaluationValue... parameterValues) { try { diff --git a/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/CheckTickFunction.java b/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/CheckTickFunction.java index a95e47d71..f1667bd09 100644 --- a/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/CheckTickFunction.java +++ b/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/CheckTickFunction.java @@ -37,6 +37,11 @@ public CheckTickFunction() { super("checktick"); } + /** + * Checks if the current tick is equal to the tick specified in the function data + * @param playerWrapper to run the function for + * @return + */ @Override public boolean function(PlayerWrapper playerWrapper) { FunctionOwner owner = this.getOwner(); diff --git a/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/ConditionFunction.java b/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/ConditionFunction.java index 9750b4a2e..b18498520 100644 --- a/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/ConditionFunction.java +++ b/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/ConditionFunction.java @@ -35,6 +35,11 @@ public ConditionFunction() { super("condition"); } + /** + * Runs a condition function + * @param playerWrapper to run the function for + * @return true if the function evalutes to BigDecimal.ONE, false otherwise + */ @Override public boolean function(PlayerWrapper playerWrapper) { try { diff --git a/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/ContainsLazyFunction.java b/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/ContainsLazyFunction.java index bbad3bfcf..b3e5f93c5 100644 --- a/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/ContainsLazyFunction.java +++ b/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/ContainsLazyFunction.java @@ -26,8 +26,16 @@ import java.math.BigDecimal; @FunctionParameter(name = "value", isLazy = true) -@FunctionParameter(name = "character", isLazy = true) +@FunctionParameter(name = "string", isLazy = true) public class ContainsLazyFunction extends AbstractFunction { + /** + * + * @param expression The expression, where this function is executed. Can be used to access the + * expression configuration. + * @param functionToken The function token from the parsed expression. + * @param parameterValues The parameter values. + * @return BigDecimal.ONE if the string contains the value, BigDecimal.ZERO otherwise + */ @Override public EvaluationValue evaluate(Expression expression, Token functionToken, EvaluationValue... parameterValues) { if (parameterValues[0].getExpressionNode().getToken().getValue().contains(parameterValues[1].getExpressionNode().getToken().getValue())) { diff --git a/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/EndsWithLazyFunction.java b/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/EndsWithLazyFunction.java index 1759f4e1b..fca53a846 100644 --- a/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/EndsWithLazyFunction.java +++ b/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/EndsWithLazyFunction.java @@ -26,6 +26,14 @@ @FunctionParameter(name = "value", isLazy = true) @FunctionParameter(name = "endsWith", isLazy = true) public class EndsWithLazyFunction extends AbstractFunction { + /** + * + * @param expression The expression, where this function is executed. Can be used to access the + * expression configuration. + * @param functionToken The function token from the parsed expression. + * @param parameterValues The parameter values. + * @return BigDecimal.ONE if the string ends with the value, BigDecimal.ZERO otherwise + */ @Override public EvaluationValue evaluate(Expression expression, Token functionToken, EvaluationValue... parameterValues) { if (parameterValues[0].getExpressionNode().getToken().getValue().endsWith(parameterValues[1].getExpressionNode().getToken().getValue())) { diff --git a/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/EqualLazyFunction.java b/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/EqualLazyFunction.java index 579291ec8..564f06731 100644 --- a/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/EqualLazyFunction.java +++ b/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/EqualLazyFunction.java @@ -28,6 +28,14 @@ @FunctionParameter(name = "stringB", isLazy = true) public class EqualLazyFunction extends AbstractFunction { + /** + * + * @param expression The expression, where this function is executed. Can be used to access the + * expression configuration. + * @param functionToken The function token from the parsed expression. + * @param parameterValues The parameter values. + * @return BigDecimal.ONE if the string equals the value, BigDecimal.ZERO otherwise + */ @Override public EvaluationValue evaluate(Expression expression, Token functionToken, EvaluationValue... parameterValues) { if(parameterValues[0].getExpressionNode().getToken().getValue().equals(parameterValues[1].getExpressionNode().getToken().getValue())) { diff --git a/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/IgnoreCaseEqualLazyFunction.java b/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/IgnoreCaseEqualLazyFunction.java index 3d55e3eca..ac443c6ec 100644 --- a/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/IgnoreCaseEqualLazyFunction.java +++ b/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/IgnoreCaseEqualLazyFunction.java @@ -27,6 +27,14 @@ @FunctionParameter(name = "stringA", isLazy = true) @FunctionParameter(name = "stringB", isLazy = true) public class IgnoreCaseEqualLazyFunction extends AbstractFunction { + /** + * + * @param expression The expression, where this function is executed. Can be used to access the + * expression configuration. + * @param functionToken The function token from the parsed expression. + * @param parameterValues The parameter values. + * @return BigDecimal.ONE if the string equals the value, BigDecimal.ZERO otherwise + */ @Override public EvaluationValue evaluate(Expression expression, Token functionToken, EvaluationValue... parameterValues) { if(parameterValues[0].getExpressionNode().getToken().getValue().equalsIgnoreCase(parameterValues[1].getExpressionNode().getToken().getValue())){ diff --git a/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/StartsWithLazyFunction.java b/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/StartsWithLazyFunction.java index 50bdd70b4..8fc1bc3a3 100644 --- a/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/StartsWithLazyFunction.java +++ b/core/src/main/java/com/clubobsidian/dynamicgui/core/function/condition/StartsWithLazyFunction.java @@ -27,7 +27,14 @@ @FunctionParameter(name = "value", isLazy = true) @FunctionParameter(name = "startsWith", isLazy = true) public class StartsWithLazyFunction extends AbstractFunction { - + /** + * + * @param expression The expression, where this function is executed. Can be used to access the + * expression configuration. + * @param functionToken The function token from the parsed expression. + * @param parameterValues The parameter values. + * @return BigDecimal.ONE if the string starts with the value, BigDecimal.ZERO otherwise + */ @Override public EvaluationValue evaluate(Expression expression, Token functionToken, EvaluationValue... parameterValues) { if(parameterValues[0].getExpressionNode().getToken().getValue().startsWith(parameterValues[1].getExpressionNode().getToken().getValue())){