@Test public void parseBoolean_valueIsNotABoolean_IllegalArgumentException() { final String value = "dummy"; try { InputParser.parseBoolean(value, INPUT_NAME); fail(); } catch (IllegalArgumentException ex) { assertTrue(ex.getMessage().contains(INPUT_NAME)); } }
public static boolean parseBoolean(String value, String inputName) { try { return BooleanUtils.toBoolean(value, BooleanValues.TRUE, BooleanValues.FALSE); } catch (IllegalArgumentException ex) { throw new IllegalArgumentException(String.format(ExceptionMsgs.INVALID_VALUE_FOR_INPUT, value, inputName)); } }
InputParser { public static boolean parseBoolean(String value, String inputName) { try { return BooleanUtils.toBoolean(value, BooleanValues.TRUE, BooleanValues.FALSE); } catch (IllegalArgumentException ex) { throw new IllegalArgumentException(String.format(ExceptionMsgs.INVALID_VALUE_FOR_INPUT, value, inputName)); } } }
InputParser { public static boolean parseBoolean(String value, String inputName) { try { return BooleanUtils.toBoolean(value, BooleanValues.TRUE, BooleanValues.FALSE); } catch (IllegalArgumentException ex) { throw new IllegalArgumentException(String.format(ExceptionMsgs.INVALID_VALUE_FOR_INPUT, value, inputName)); } } private  InputParser(); }
InputParser { public static boolean parseBoolean(String value, String inputName) { try { return BooleanUtils.toBoolean(value, BooleanValues.TRUE, BooleanValues.FALSE); } catch (IllegalArgumentException ex) { throw new IllegalArgumentException(String.format(ExceptionMsgs.INVALID_VALUE_FOR_INPUT, value, inputName)); } } private  InputParser(); static String parseDescription(String descr); static short parseShort(String value, String inputName); static int parseInt(String value, String inputName); static boolean parseBoolean(String value, String inputName); static Region parseRegion(String value); static T parseEnum(String value, Class<T> clazz, String inputName); }
InputParser { public static boolean parseBoolean(String value, String inputName) { try { return BooleanUtils.toBoolean(value, BooleanValues.TRUE, BooleanValues.FALSE); } catch (IllegalArgumentException ex) { throw new IllegalArgumentException(String.format(ExceptionMsgs.INVALID_VALUE_FOR_INPUT, value, inputName)); } } private  InputParser(); static String parseDescription(String descr); static short parseShort(String value, String inputName); static int parseInt(String value, String inputName); static boolean parseBoolean(String value, String inputName); static Region parseRegion(String value); static T parseEnum(String value, Class<T> clazz, String inputName);  }