Ejemplo n.º 1
0
 /**
  * Gets the value of a config option of the specified component. This is done by first checking,
  * which value the given option was set to using {@link #applyConfigEntry(AbstractComponent,
  * ConfigEntry)}. If the value has not been changed, the default value for this option is
  * returned. Note, that this method will not work properly if the component options are changed
  * internally surpassing the component manager (which is discouraged).
  *
  * @param <T> The type of the config option, e.g. String, boolean, integer.
  * @param component The component, which has the specified option.
  * @param option The option for which we want to know its value.
  * @return The value of the specified option in the specified component.
  */
 public <T> T getConfigOptionValue(AbstractComponent component, ConfigOption<T> option) {
   T object = pool.getLastValidConfigValue(component, option);
   if (object == null) {
     return option.getDefaultValue();
   } else {
     return object;
   }
 }