brooklyn.policy
Class EnricherSpec<T extends Enricher>

java.lang.Object
  extended by brooklyn.policy.EnricherSpec<T>
Type Parameters:
T - The type of enricher to be created
All Implemented Interfaces:
Serializable

public class EnricherSpec<T extends Enricher>
extends Object
implements Serializable

Gives details of an enricher to be created. It describes the enricher's configuration, and is reusable to create multiple enrichers with the same configuration. To create an EnricherSpec, it is strongly encouraged to use create(...) methods.

See Also:
Serialized Form

Constructor Summary
protected EnricherSpec(Class<T> type)
           
 
Method Summary
 EnricherSpec<T> configure(CharSequence key, Object val)
           
<V> EnricherSpec<T>
configure(brooklyn.config.ConfigKey.HasConfigKey<V> key, Task<? extends V> val)
           
<V> EnricherSpec<T>
configure(brooklyn.config.ConfigKey.HasConfigKey<V> key, V val)
           
<V> EnricherSpec<T>
configure(brooklyn.config.ConfigKey<V> key, Task<? extends V> val)
           
<V> EnricherSpec<T>
configure(brooklyn.config.ConfigKey<V> key, V val)
           
 EnricherSpec<T> configure(Map<?,?> val)
           
<V> EnricherSpec<T>
configureIfNotNull(brooklyn.config.ConfigKey<V> key, V val)
           
static
<T extends Enricher>
EnricherSpec<T>
create(Class<T> type)
          Creates a new EnricherSpec instance for an enricher of the given type.
static
<T extends Enricher>
EnricherSpec<T>
create(Map<?,?> config, Class<T> type)
          Creates a new EnricherSpec instance with the given config, for an enricher of the given type.
 EnricherSpec<T> displayName(String val)
           
 Map<brooklyn.config.ConfigKey<?>,Object> getConfig()
           
 String getDisplayName()
           
 Map<String,?> getFlags()
           
 Class<T> getType()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EnricherSpec

protected EnricherSpec(Class<T> type)
Method Detail

create

public static <T extends Enricher> EnricherSpec<T> create(Class<T> type)
Creates a new EnricherSpec instance for an enricher of the given type. The returned EnricherSpec can then be customized.

Parameters:
type - A Enricher class

create

public static <T extends Enricher> EnricherSpec<T> create(Map<?,?> config,
                                                          Class<T> type)
Creates a new EnricherSpec instance with the given config, for an enricher of the given type. This is primarily for groovy code; equivalent to EnricherSpec.create(type).configure(config).

Parameters:
config - The spec's configuration (see configure(Map)).
type - An Enricher class

displayName

public EnricherSpec<T> displayName(String val)

configure

public EnricherSpec<T> configure(Map<?,?> val)

configure

public EnricherSpec<T> configure(CharSequence key,
                                 Object val)

configure

public <V> EnricherSpec<T> configure(brooklyn.config.ConfigKey<V> key,
                                     V val)

configureIfNotNull

public <V> EnricherSpec<T> configureIfNotNull(brooklyn.config.ConfigKey<V> key,
                                              V val)

configure

public <V> EnricherSpec<T> configure(brooklyn.config.ConfigKey<V> key,
                                     Task<? extends V> val)

configure

public <V> EnricherSpec<T> configure(brooklyn.config.ConfigKey.HasConfigKey<V> key,
                                     V val)

configure

public <V> EnricherSpec<T> configure(brooklyn.config.ConfigKey.HasConfigKey<V> key,
                                     Task<? extends V> val)

getType

public Class<T> getType()
Returns:
The type of the enricher

getDisplayName

public String getDisplayName()
Returns:
The display name of the enricher

getFlags

public Map<String,?> getFlags()
Returns:
Read-only construction flags
See Also:
declarations on the enricher type

getConfig

public Map<brooklyn.config.ConfigKey<?>,Object> getConfig()
Returns:
Read-only configuration values

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.