Class ParserHelper

java.lang.Object
io.helidon.common.ParserHelper

public class ParserHelper extends Object
Utility class for parsing.
  • Method Details

    • parseNonNegative

      public static <T extends Throwable> int parseNonNegative(String s, int radix, Supplier<T> supplier) throws T
      Throws exception if value returned is negative. Method Integer.parseUnsignedInt(String, int) can return negative numbers.
      Type Parameters:
      T - type of throwable
      Parameters:
      s - string to parse
      radix - the number radix
      supplier - throwable value
      Returns:
      the number
      Throws:
      T - throwable if number is negative