/** * Query to see if an option has been set. * * @param opt Short name of the option * @return true if set, false if not */ public boolean hasOption(String opt) { return options.contains(resolveOption(opt)); }
/** * Return a version of this <code>Option</code> converted to a particular type. * * @param opt the name of the option * @return the value parsed into a particular object * @throws ParseException if there are problems turning the option value into the desired type * @see PatternOptionBuilder * @since 1.2 */ public Object getParsedOptionValue(String opt) throws ParseException { String res = getOptionValue(opt); Option option = resolveOption(opt); if (option == null || res == null) { return null; } return TypeHandler.createValue(res, option.getType()); }
/** * Query to see if an option has been set. * * @param opt Short name of the option * @return true if set, false if not */ public boolean hasOption(String opt) { return options.contains(resolveOption(opt)); }
/** * Query to see if an option has been set. * * @param opt Short name of the option * @return true if set, false if not */ public boolean hasOption(String opt) { return options.contains(resolveOption(opt)); }
/** * Query to see if an option has been set. * * @param opt Short name of the option * @return true if set, false if not */ public boolean hasOption(String opt) { return options.contains(resolveOption(opt)); }
/** * Return a version of this <code>Option</code> converted to a particular type. * * @param opt the name of the option * @return the value parsed into a particular object * @throws ParseException if there are problems turning the option value into the desired type * @see PatternOptionBuilder * @since 1.2 */ public Object getParsedOptionValue(String opt) throws ParseException { String res = getOptionValue(opt); Option option = resolveOption(opt); if (option == null || res == null) { return null; } return TypeHandler.createValue(res, option.getType()); }
/** * Return a version of this <code>Option</code> converted to a particular type. * * @param opt the name of the option * @return the value parsed into a particluar object * @throws ParseException if there are problems turning the option value into the desired type * @see PatternOptionBuilder */ public Object getParsedOptionValue(String opt) throws ParseException { String res = getOptionValue(opt); Option option = resolveOption(opt); if (option == null) { return null; } Object type = option.getType(); return (res == null) ? null : TypeHandler.createValue(res, type); }
/** * Return a version of this <code>Option</code> converted to a particular type. * * @param opt the name of the option * @return the value parsed into a particluar object * @throws ParseException if there are problems turning the option value into the desired type * @see PatternOptionBuilder */ public Object getParsedOptionValue(String opt) throws ParseException { String res = getOptionValue(opt); Option option = resolveOption(opt); if (option == null) { return null; } Object type = option.getType(); return (res == null) ? null : TypeHandler.createValue(res, type); }