/** * Get a list of BigIntegers associated with the given configuration key. * If the key doesn't map to an existing object, the default value is * returned. * * @param key The configuration key. * @param defaultValue The default value. * @return The associated List of BigIntegers. * * @throws ConversionException is thrown if the key maps to an * object that is not a list of BigIntegers. */ public List<BigInteger> getBigIntegerList(final String key, final List<BigInteger> defaultValue) { return getList(BigInteger.class, key, defaultValue); }
/** * Get a list of Colors associated with the given configuration key. * If the key doesn't map to an existing object, the default value is * returned. * * @param key The configuration key. * @param defaultValue The default value. * @return The associated List of Colors. * * @throws ConversionException is thrown if the key maps to an * object that is not a list of Colors. */ public List<Color> getColorList(final String key, final List<Color> defaultValue) { return getList(Color.class, key, defaultValue); }
/** * Get a list of Short objects associated with the given configuration key. * If the key doesn't map to an existing object, the default value is * returned. * * @param key The configuration key. * @param defaultValue The default value. * @return The associated List of Shorts. * * @throws ConversionException is thrown if the key maps to an * object that is not a list of shorts. */ public List<Short> getShortList(final String key, final List<Short> defaultValue) { return getList(Short.class, key, defaultValue); }
/** * Get a list of BigDecimals associated with the given configuration key. * If the key doesn't map to an existing object, the default value is * returned. * * @param key The configuration key. * @param defaultValue The default value. * @return The associated List of BigDecimals. * * @throws ConversionException is thrown if the key maps to an * object that is not a list of BigDecimals. */ public List<BigDecimal> getBigDecimalList(final String key, final List<BigDecimal> defaultValue) { return getList(BigDecimal.class, key, defaultValue); }
/** * Get a list of Byte objects associated with the given configuration key. * If the key doesn't map to an existing object, the default value is * returned. * * @param key The configuration key. * @param defaultValue The default value. * @return The associated List of Bytes. * * @throws ConversionException is thrown if the key maps to an * object that is not a list of bytes. */ public List<Byte> getByteList(final String key, final List<Byte> defaultValue) { return getList(Byte.class, key, defaultValue); }
/** * Get a list of URLs associated with the given configuration key. * If the key doesn't map to an existing object, the default value is * returned. * * @param key The configuration key. * @param defaultValue The default value. * @return The associated List of URLs. * * @throws ConversionException is thrown if the key maps to an * object that is not a list of URLs. */ public List<URL> getURLList(final String key, final List<URL> defaultValue) { return getList(URL.class, key, defaultValue); }
/** * Get a list of Locales associated with the given configuration key. * If the key doesn't map to an existing object, the default value is * returned. * * @param key The configuration key. * @param defaultValue The default value. * @return The associated List of Locales. * * @throws ConversionException is thrown if the key maps to an * object that is not a list of Locales. */ public List<Locale> getLocaleList(final String key, final List<Locale> defaultValue) { return getList(Locale.class, key, defaultValue); }
/** * Get a list of Boolean objects associated with the given * configuration key. If the key doesn't map to an existing object, * the default value is returned. * * @param key The configuration key. * @param defaultValue The default value. * @return The associated List of Booleans. * * @throws ConversionException is thrown if the key maps to an * object that is not a list of booleans. */ public List<Boolean> getBooleanList(final String key, final List<Boolean> defaultValue) { return getList(Boolean.class, key, defaultValue); }
/** * Get a list of Float objects associated with the given * configuration key. If the key doesn't map to an existing object, * the default value is returned. * * @param key The configuration key. * @param defaultValue The default value. * @return The associated List of Floats. * * @throws ConversionException is thrown if the key maps to an * object that is not a list of floats. */ public List<Float> getFloatList(final String key, final List<Float> defaultValue) { return getList(Float.class, key, defaultValue); }
/** * Get a list of Double objects associated with the given * configuration key. If the key doesn't map to an existing object, * the default value is returned. * * @param key The configuration key. * @param defaultValue The default value. * @return The associated List of Doubles. * * @throws ConversionException is thrown if the key maps to an * object that is not a list of doubles. */ public List<Double> getDoubleList(final String key, final List<Double> defaultValue) { return getList(Double.class, key, defaultValue); }
/** * Get a list of Integer objects associated with the given * configuration key. If the key doesn't map to an existing object, * the default value is returned. * * @param key The configuration key. * @param defaultValue The default value. * @return The associated List of Integers. * * @throws ConversionException is thrown if the key maps to an * object that is not a list of integers. */ public List<Integer> getIntegerList(final String key, final List<Integer> defaultValue) { return getList(Integer.class, key, defaultValue); }
/** * Get a list of Long objects associated with the given configuration key. * If the key doesn't map to an existing object, the default value is * returned. * * @param key The configuration key. * @param defaultValue The default value. * @return The associated List of Longs. * * @throws ConversionException is thrown if the key maps to an * object that is not a list of longs. */ public List<Long> getLongList(final String key, final List<Long> defaultValue) { return getList(Long.class, key, defaultValue); }
/** * Get a list of URIs associated with the given configuration key. * If the key doesn't map to an existing object, the default value is * returned. * * @param key The configuration key. * @param defaultValue The default value. * @return The associated List of URIs. * * @throws ConversionException is thrown if the key maps to an * object that is not a list of URIs. */ public List<URI> getURIList(final String key, final List<URI> defaultValue) { return getList(URI.class, key, defaultValue); }
/** * Get a list of Calendars associated with the given configuration key. * If the property is a list of Strings, they will be parsed with the * specified format pattern. If the key doesn't map to an existing object, * the default value is returned. * * @param key The configuration key. * @param defaultValue The default value. * @param format The non-localized {@link java.text.DateFormat} pattern. * @return The associated Calendar list if the key is found. * * @throws ConversionException is thrown if the key maps to an * object that is not a list of Calendars. */ public List<Calendar> getCalendarList(final String key, final List<Calendar> defaultValue, final String format) { TEMP_DATE_FORMAT.set(format); try { return getList(Calendar.class, key, defaultValue); } finally { TEMP_DATE_FORMAT.remove(); } }
/** * Get a list of Dates associated with the given configuration key. * If the property is a list of Strings, they will be parsed with the * specified format pattern. If the key doesn't map to an existing object, * the default value is returned. * * @param key The configuration key. * @param defaultValue The default value. * @param format The non-localized {@link java.text.DateFormat} pattern. * @return The associated Date list if the key is found. * * @throws ConversionException is thrown if the key maps to an * object that is not a list of Dates. */ public List<Date> getDateList(final String key, final List<Date> defaultValue, final String format) { TEMP_DATE_FORMAT.set(format); try { return getList(Date.class, key, defaultValue); } finally { TEMP_DATE_FORMAT.remove(); } }
public static List<String> getList(String key, List<String> defaultValue) { logAccess(key, defaultValue); List<?> configList = config.getList(key, defaultValue); List<String> toReturn = new ArrayList<String>(configList.size()); for (Object item : configList) { toReturn.add((String)item); } return toReturn; }