protected static void throwFieldConvertError(String value, String type) throws FieldConvertError { throw new FieldConvertError("invalid UTC " + type + " value: " + value); }
private FieldException newIncorrectDataException(FieldConvertError e, int tag) { return new FieldException(SessionRejectReason.INCORRECT_DATA_FORMAT_FOR_VALUE, e.getMessage(), tag); }
protected static void throwFieldConvertError(String value, String type) throws FieldConvertError { throw new FieldConvertError("invalid UTC " + type + " value: " + value); }
private FieldException newIncorrectDataException(FieldConvertError e, int tag) { return new FieldException(SessionRejectReason.INCORRECT_DATA_FORMAT_FOR_VALUE, e.getMessage(), tag); }
protected static void throwFieldConvertError(String value, String type) throws FieldConvertError { throw new FieldConvertError("invalid UTC " + type + " value: " + value); }
private FieldException newIncorrectDataException(FieldConvertError e, int tag) { return new FieldException(SessionRejectReason.INCORRECT_DATA_FORMAT_FOR_VALUE, e.getMessage(), tag); }
/** * Convert a String value to a decimal. * * @param value the String value to convert * @return the parsed BigDecimal * @throws FieldConvertError if the String is not a valid decimal pattern. */ public static BigDecimal convert(String value) throws FieldConvertError { try { return new BigDecimal(value); } catch (NumberFormatException e) { throw new FieldConvertError("invalid double value: " + value); } } }
public SessionSchedule create(SessionID sessionID, SessionSettings settings) throws ConfigError { try { return new DefaultSessionSchedule(settings, sessionID); } catch (final FieldConvertError e) { throw new ConfigError(e.getMessage()); } } }
/** * Convert a String value to a decimal. * * @param value the String value to convert * @return the parsed BigDecimal * @throws FieldConvertError if the String is not a valid decimal pattern. */ public static BigDecimal convert(String value) throws FieldConvertError { try { return new BigDecimal(value); } catch (NumberFormatException e) { throw new FieldConvertError("invalid double value: " + value); } } }
public SessionSchedule create(SessionID sessionID, SessionSettings settings) throws ConfigError { try { return new DefaultSessionSchedule(settings, sessionID); } catch (final FieldConvertError e) { throw new ConfigError(e.getMessage()); } } }
/** * Convert a String value to a decimal. * * @param value the String value to convert * @return the parsed BigDecimal * @throws FieldConvertError if the String is not a valid decimal pattern. */ public static BigDecimal convert(String value) throws FieldConvertError { try { return new BigDecimal(value); } catch (NumberFormatException e) { throw new FieldConvertError("invalid double value: " + value); } } }
public SessionSchedule create(SessionID sessionID, SessionSettings settings) throws ConfigError { try { return new DefaultSessionSchedule(settings, sessionID); } catch (final FieldConvertError e) { throw new ConfigError(e.getMessage()); } } }
/** * Convert a String value to a character. * * @param value * @return the converted character * @throws FieldConvertError if String length != 1 */ public static char convert(String value) throws FieldConvertError { if (value.length() != 1) { throw new FieldConvertError("invalid character value: " + value); } return value.charAt(0); } }
protected int getIntSetting(String key) throws ConfigError { try { return IntConverter.convert(settings.getString(key)); } catch (FieldConvertError e) { throw (ConfigError) new ConfigError(e.getMessage()).fillInStackTrace(); } }
/** * Convert a String value to a character. * * @param value * @return the converted character * @throws FieldConvertError if String length != 1 */ public static char convert(String value) throws FieldConvertError { if (value.length() != 1) { throw new FieldConvertError("invalid character value: " + value); } return value.charAt(0); } }
protected int getIntSetting(String key) throws ConfigError { try { return IntConverter.convert(settings.getString(key)); } catch (FieldConvertError e) { throw (ConfigError) new ConfigError(e.getMessage()).fillInStackTrace(); } }
/** * Converts a String value to a boolean. * * @param value the String value to convert * @return true if "Y" and false if "N" * @throws FieldConvertError raised for any value other than "Y" or "N". */ public static boolean convert(String value) throws FieldConvertError { if (YES.equals(value)) { return true; } else if (NO.equals(value)) { return false; } else { throw new FieldConvertError("invalid boolean value: " + value); } } }
protected int getIntSetting(String key) throws ConfigError { try { return IntConverter.convert(settings.getString(key)); } catch (FieldConvertError e) { throw (ConfigError) new ConfigError(e.getMessage()).fillInStackTrace(); } }
/** * Convert a String value to a character. * * @param value * @return the converted character * @throws FieldConvertError if String length != 1 */ public static char convert(String value) throws FieldConvertError { if (value.length() != 1) { throw new FieldConvertError("invalid character value: " + value); } return value.charAt(0); } }
throw new ConfigError(e.getMessage(), e);