Make helper methods static
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Thu, 20 Mar 2025 22:06:44 +0000 (00:06 +0200)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Thu, 20 Mar 2025 22:06:44 +0000 (00:06 +0200)
src/main/java/eu/svjatoslav/commons/cli_helper/CLIHelper.java

index e86c58b..4804e6f 100755 (executable)
@@ -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