Class InputResult

java.lang.Object
com.jahnreil_stratpoint.InputResult

public class InputResult extends Object
Represents the result of an input validation operation. Contains information about the validated input value, validity status, and optionally a double value.
  • Field Details

    • valueInt

      public int valueInt
    • isValid

      public boolean isValid
    • valueDouble

      public double valueDouble
  • Constructor Details

    • InputResult

      public InputResult(int valueInt, boolean isValid, double valueDouble)
      Constructs an InputResult object with specified values.
      Parameters:
      valueInt - The validated integer value from the input.
      isValid - Boolean indicating whether the input is valid.
      valueDouble - Optional double value from the input (default: 0 if not applicable).
  • Method Details

    • inputCheck

      public static InputResult inputCheck(String input, int maxChoice, int inputType)
      Validates user input based on specified criteria.
      Parameters:
      input - The input string to be validated.
      maxChoice - Maximum allowed value or range for validation.
      inputType - Type of input validation to perform: 1 - Convert string to integer with maximum value check, 2 - Convert string to integer, 3 - Convert string to double.
      Returns:
      InputResult object containing validated values and validity status.