/** * Gets a property of type {@link PropertyType#BOOLEAN}, interpreting the value properly (using * <code>Boolean.parseBoolean()</code>). * * @param property * property to get * @return property value * @throws IllegalArgumentException * if the property is of the wrong type */ public boolean getBoolean(Property property) { checkType(property, PropertyType.BOOLEAN); return Boolean.parseBoolean(get(property)); }
/** * Gets a property of type {@link PropertyType#COUNT}, interpreting the value properly (as an * integer). * * @param property * property to get * @return property value * @throws IllegalArgumentException * if the property is of the wrong type */ public int getCount(Property property) { checkType(property, PropertyType.COUNT); String countString = get(property); return Integer.parseInt(countString); }
/** * Gets a property of type {@link PropertyType#PATH}, interpreting the value properly, replacing * supported environment variables. * * @param property * property to get * @return property value * @throws IllegalArgumentException * if the property is of the wrong type * @see Constants#PATH_PROPERTY_ENV_VARS */ public String getPath(Property property) { checkType(property, PropertyType.PATH); String pathString = get(property); if (pathString == null) return null; for (String replaceableEnvVar : Constants.PATH_PROPERTY_ENV_VARS) { String envValue = System.getenv(replaceableEnvVar); if (envValue != null) pathString = pathString.replace("$" + replaceableEnvVar, envValue); } return pathString; }
/** * Gets a property of type {@link PropertyType#TIMEDURATION}, interpreting the value properly. * * @param property * property to get * @return property value * @throws IllegalArgumentException * if the property is of the wrong type */ public long getTimeInMillis(Property property) { checkType(property, PropertyType.TIMEDURATION); return ConfigurationTypeHelper.getTimeInMillis(get(property)); }
/** * Gets a property of type {@link PropertyType#FRACTION}, interpreting the value properly. * * @param property * property to get * @return property value * @throws IllegalArgumentException * if the property is of the wrong type */ public double getFraction(Property property) { checkType(property, PropertyType.FRACTION); return ConfigurationTypeHelper.getFraction(get(property)); }
checkType(property, PropertyType.PREFIX);
checkType(property, PropertyType.PORT);
/** * Gets a property of type {@link PropertyType#BOOLEAN}, interpreting the value properly (using * <code>Boolean.parseBoolean()</code>). * * @param property * property to get * @return property value * @throws IllegalArgumentException * if the property is of the wrong type */ public boolean getBoolean(Property property) { checkType(property, PropertyType.BOOLEAN); return Boolean.parseBoolean(get(property)); }
/** * Gets a property of type {@link PropertyType#COUNT}, interpreting the value properly (as an * integer). * * @param property * property to get * @return property value * @throws IllegalArgumentException * if the property is of the wrong type * @see #getTimeInMillis(String) */ public int getCount(Property property) { checkType(property, PropertyType.COUNT); String countString = get(property); return Integer.parseInt(countString); }
/** * Gets a property of type {@link PropertyType#PATH}, interpreting the value properly, replacing * supported environment variables. * * @param property * property to get * @return property value * @throws IllegalArgumentException * if the property is of the wrong type * @see Constants#PATH_PROPERTY_ENV_VARS */ public String getPath(Property property) { checkType(property, PropertyType.PATH); String pathString = get(property); if (pathString == null) return null; for (String replaceableEnvVar : Constants.PATH_PROPERTY_ENV_VARS) { String envValue = System.getenv(replaceableEnvVar); if (envValue != null) pathString = pathString.replace("$" + replaceableEnvVar, envValue); } return pathString; }
/** * Gets a property of type {@link PropertyType#TIMEDURATION}, interpreting the value properly. * * @param property * property to get * @return property value * @throws IllegalArgumentException * if the property is of the wrong type * @see #getTimeInMillis(String) */ public long getTimeInMillis(Property property) { checkType(property, PropertyType.TIMEDURATION); return getTimeInMillis(get(property)); }
/** * Gets a property of type {@link PropertyType#FRACTION}, interpreting the value properly. * * @param property * property to get * @return property value * @throws IllegalArgumentException * if the property is of the wrong type * @see #getFraction(String) */ public double getFraction(Property property) { checkType(property, PropertyType.FRACTION); return getFraction(get(property)); }
/** * Gets a property of type {@link PropertyType#MEMORY}, interpreting the value properly. * * @param property * property to get * @return property value * @throws IllegalArgumentException * if the property is of the wrong type * @see #getMemoryInBytes(String) */ public long getMemoryInBytes(Property property) { checkType(property, PropertyType.MEMORY); String memString = get(property); return getMemoryInBytes(memString); }
checkType(property, PropertyType.PREFIX);
checkType(property, PropertyType.PORT);