From: Svjatoslav Agejenko Date: Thu, 20 Mar 2025 22:06:44 +0000 (+0200) Subject: Make helper methods static X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=db0bfd48dc21509c14cd957c288056e1bfe27809;p=cli-helper.git Make helper methods static --- diff --git a/src/main/java/eu/svjatoslav/commons/cli_helper/CLIHelper.java b/src/main/java/eu/svjatoslav/commons/cli_helper/CLIHelper.java index e86c58b..4804e6f 100755 --- a/src/main/java/eu/svjatoslav/commons/cli_helper/CLIHelper.java +++ b/src/main/java/eu/svjatoslav/commons/cli_helper/CLIHelper.java @@ -72,7 +72,7 @@ public class CLIHelper { * @param max The maximum acceptable value (inclusive), or null if no upper bound * @return A Float value that the user entered, or the defaultValue, or null if no defaultValue was given */ - public Float askFloat(String prompt, Float defaultValue, Float min, Float max) { + public static Float askFloat(String prompt, Float defaultValue, Float min, Float max) { while (true) { // If we have a defaultValue, display it in brackets; otherwise display no default String displayPrompt = prompt @@ -130,7 +130,7 @@ public class CLIHelper { * @param max The maximum acceptable value (inclusive), or null if no upper bound * @return A Long value that the user entered, or the defaultValue, or null if no defaultValue was given */ - public Long askLong(String prompt, Long defaultValue, Long min, Long max) { + public static Long askLong(String prompt, Long defaultValue, Long min, Long max) { while (true) { // If we have a defaultValue, display it in brackets; otherwise display no default String displayPrompt = prompt @@ -188,7 +188,7 @@ public class CLIHelper { * @param max The maximum acceptable value (inclusive), or null if no upper bound * @return An integer value that the user entered, or the defaultValue, or null if no defaultValue was given */ - public Integer askInteger(String prompt, Integer defaultValue, Integer min, Integer max) { + public static Integer askInteger(String prompt, Integer defaultValue, Integer min, Integer max) { while (true) { // If we have a defaultValue, display it in brackets; otherwise display no default String displayPrompt = prompt