Class ScannerKit

java.lang.Object
com.iohao.net.extension.client.kit.ScannerKit

public final class ScannerKit extends Object
Console input helper utilities for simulated clients.
Author:
渔民小镇
date:
2023-07-04
  • Method Details

    • log

      public static void log(Runnable runnable)
      Skips the runnable when console input is disabled.
      Parameters:
      runnable - runnable
    • nextLine

      public static String nextLine(String defaultValue)
      Reads a String from console input.
          If console input is disabled, returns the default value.
      
      Parameters:
      defaultValue - default value when console input is disabled
      Returns:
      String value
    • nextLine

      public static String nextLine()
      Reads a String from console input.
      Returns:
      String value
    • nextLong

      public static long nextLong(long defaultValue)
      Reads a long from console input.
          If console input is disabled, returns the default value.
      
      Parameters:
      defaultValue - default value when console input is disabled
      Returns:
      long value
    • nextLong

      public static long nextLong()
      Reads a long from console input.
      Returns:
      long value
    • nextInt

      public static int nextInt(int defaultValue)
      Reads an int from console input.
          If console input is disabled, returns the default value.
      
      Parameters:
      defaultValue - default value when console input is disabled
      Returns:
      int value
    • nextInt

      public static int nextInt()
      Reads an int from console input.
      Returns:
      int value