public long getLong(String key) { Lang.denyNull("key", key); _checkKey(key); try { return Long.parseLong(getProperty(key)); } catch (Exception e) { throw new RuntimeException(String.format("Configuration key '%s' cannot be parsed.", key)); } }
public float getFloat(String key) { Lang.denyNull("key", key); _checkKey(key); try { return Float.parseFloat(getProperty(key)); } catch (Exception e) { throw new RuntimeException(String.format("Configuration key '%s' cannot be parsed.", key)); } }
public boolean getBoolean(String key) { Lang.denyNull("key", key); _checkKey(key); try { return Boolean.parseBoolean(getProperty(key)); } catch (Exception e) { throw new RuntimeException(String.format("Configuration key '%s' cannot be parsed.", key)); } }
public double getDouble(String key) { Lang.denyNull("key", key); _checkKey(key); try { return Double.parseDouble(getProperty(key)); } catch (Exception e) { throw new RuntimeException(String.format("Configuration key '%s' cannot be parsed.", key)); } }
public int getInt(String key) { Lang.denyNull("key", key); _checkKey(key); try { return Integer.parseInt(getProperty(key)); } catch (Exception e) { throw new RuntimeException(String.format("Configuration key '%s' cannot be parsed.", key)); } }
public <T extends Enum<T>> T getEnum(String key, Class<T> enumType) { Lang.denyNull("key", key); Lang.denyNull("enumType", enumType); _checkKey(key); try { return Enum.valueOf(enumType, getProperty(key)); } catch (Exception e) { throw new RuntimeException(String.format("Configuration key '%s' cannot be parsed.", key)); } }