All Downloads are FREE. Search and download functionalities are using the official Maven repository.

brooklyn.config.ConfigMap Maven / Gradle / Ivy

Go to download

Utility classes and methods developed for Brooklyn but not dependendent on Brooklyn or much else

There is a newer version: 0.7.0-M1
Show newest version
package brooklyn.config;

import java.util.Map;

import brooklyn.config.ConfigKey.HasConfigKey;

import com.google.common.base.Predicate;

public interface ConfigMap {
    
    /** @see #getConfig(ConfigKey, Object), with default value as per the key, or null */
    public  T getConfig(ConfigKey key);
    /** @see #getConfig(ConfigKey, Object), with default value as per the key, or null  */
    public  T getConfig(HasConfigKey key);
    /** @see #getConfig(ConfigKey, Object), with provided default value if not set */
    public  T getConfig(HasConfigKey key, T defaultValue);
    /** returns value stored against the given key,
     * resolved (if it is a Task, possibly blocking), and coerced to the appropriate type, 
     * or given default value if not set, 
     * unless the default value is null in which case it returns the default*/ 
    public  T getConfig(ConfigKey key, T defaultValue);

    /** returns the value stored against the given key, 
     * not any default,
     * not resolved (and guaranteed non-blocking)
     * and not type-coerced
     * @return raw, unresolved, uncoerced value of key in map, locally or inherited, but not any default on the key
     */
    public Object getRawConfig(ConfigKey key);

    /** returns a map of all config keys to their raw (unresolved+uncoerced) contents */
    public Map,Object> getAllConfig();

    /** returns submap matching the given filter predicate; see ConfigPredicates for common predicates */
    public ConfigMap submap(Predicate> filter);

    /** returns a read-only map view which has string keys (corresponding to the config key names);
     * callers encouraged to use the typed keys (and so not use this method),
     * but in some compatibility areas having a Properties-like view is useful */
    public Map asMapWithStringKeys();
    
    public int size();
    
    public boolean isEmpty();
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy