brooklyn.config.ConfigKey Maven / Gradle / Ivy
Show all versions of brooklyn-utils-common Show documentation
package brooklyn.config;
import java.util.Collection;
import com.google.common.reflect.TypeToken;
/**
* Represents the name of a piece of typed configuration data for an entity.
*
* Two ConfigKeys should be considered equal if they have the same FQN.
*/
public interface ConfigKey {
/**
* Returns the description of the configuration parameter, for display.
*/
String getDescription();
/**
* Returns the name of the configuration parameter, in a dot-separated namespace (FQN).
*/
String getName();
/**
* Returns the constituent parts of the configuration parameter name as a {@link Collection}.
*/
Collection getNameParts();
/**
* Returns the Guava TypeToken, including info on generics.
*/
TypeToken getTypeToken();
/**
* Returns the type of the configuration parameter data.
*
* This returns a "super" of T only in the case where T is generified,
* and in such cases it returns the Class instance for the unadorned T ---
* i.e. for List this returns Class ---
* this is of course because there is no actual Class> instance.
*/
Class super T> getType();
/**
* Returns the name of of the configuration parameter data type, as a {@link String}.
*/
String getTypeName();
/**
* Returns the default value of the configuration parameter.
*/
T getDefaultValue();
/**
* Returns true if a default configuration value has been set.
*/
boolean hasDefaultValue();
/**
* @return True if the configuration can be changed at runtime.
*/
boolean isReconfigurable();
/** Interface for elements which want to be treated as a config key without actually being one
* (e.g. config attribute sensors).
*/
public interface HasConfigKey {
public ConfigKey getConfigKey();
}
}