code: public <T> T getPropertyValueAs(final String propertyName, final boolean required, final Class<T> type) {
      try {
        return convert(getPropertyValue(propertyName, required), type);
      }
      catch (ConversionException e) {
        if (required) {
          throw new ConfigurationException(String.format(
            "Failed to get the value of configuration setting property (%1$s) as type (%2$s)!", propertyName,
              ClassUtils.getName(type)), e);
        }
  
        return null;
      }
    }
docs: Gets the value of the configuration property identified by name as a value of the specified Class type.
  The required parameter can be used to indicate the property is not required and that a ConfigurationException
  should not be thrown if the property is undeclared or undefined.
  
  @param propertyName a String value indicating the name of the configuration property.
  @param required used to indicate whether the configuration property is required to be declared and defined.
  @param type the expected Class type of the configuration property value.
  @return the value of the configuration property identified by name.
  @throws ConfigurationException if and only if the property is required and the property is either undeclared
  or undefined.