Class ScannerKit

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

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

    • ScannerKit

      public ScannerKit()
  • Method Details

    • log

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

      public 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 String nextLine()
      Reads a String from console input.
      Returns:
      String value
    • nextLong

      public 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 long nextLong()
      Reads a long from console input.
      Returns:
      long value
    • nextInt

      public 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 int nextInt()
      Reads an int from console input.
      Returns:
      int value