public abstract class AbstractBrooklynObjectSpec<T,SpecT extends AbstractBrooklynObjectSpec<T,SpecT>>
extends java.lang.Object
implements java.io.Serializable
BrooklynObject
.
In addition to the contract defined by the code,
subclasses should provide a public static create(Class)
method to create an instance of the spec for the target type indicated by the argument.
The spec is then passed to type-specific methods,
e.g. EntityManager.createEntity(org.apache.brooklyn.api.entity.EntitySpec)
to create a managed instance of the target type.
Modifier and Type | Method and Description |
---|---|
SpecT |
addSearchPath(java.util.List<java.lang.String> searchPath) |
SpecT |
catalogItemId(java.lang.String val)
Set the catalog item ID that defined this object;
since https://issues.apache.org/jira/browse/BROOKLYN-445 this must no longer be used to indicate
a caller-context catalog item that should be used for search purposes;
instead use
catalogItemIdAndSearchPath(java.lang.String, java.util.Collection<java.lang.String>) . |
SpecT |
catalogItemIdAndSearchPath(java.lang.String catalogItemId,
java.util.Collection<java.lang.String> searchPath)
Set the immediate catalog item ID of this object, and the search path of other catalog items used to define it.
|
SpecT |
catalogItemIdIfNotNull(java.lang.String val)
Deprecated.
since 0.11.0, most callers would want
stackCatalogItemId(String) instead, though semantics are different |
void |
clearConfig()
Clears the config map, removing any config previously set.
|
SpecT |
configure(java.lang.CharSequence key,
java.lang.Object val) |
<V> SpecT |
configure(ConfigKey.HasConfigKey<V> key,
Task<? extends V> val) |
<V> SpecT |
configure(ConfigKey.HasConfigKey<V> key,
V val) |
<V> SpecT |
configure(ConfigKey<V> key,
Task<? extends V> val) |
<V> SpecT |
configure(ConfigKey<V> key,
V val) |
SpecT |
configure(java.util.Map<?,?> val)
strings inserted as flags, config keys inserted as config keys;
if you want to force one or the other, create a ConfigBag and convert to the appropriate map type
|
<V> SpecT |
configureIfNotNull(ConfigKey<V> key,
V val) |
SpecT |
displayName(java.lang.String val) |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getCatalogItemId()
Same as
BrooklynObject.getCatalogItemId() . |
java.util.List<java.lang.String> |
getCatalogItemIdSearchPath()
|
java.util.Map<ConfigKey<?>,java.lang.Object> |
getConfig() |
java.lang.String |
getDisplayName() |
java.util.Map<java.lang.String,?> |
getFlags() |
java.util.List<SpecParameter<?>> |
getParameters()
A list of configuration options that the entity supports.
|
java.util.Set<java.lang.Object> |
getTags() |
java.lang.Class<? extends T> |
getType() |
int |
hashCode() |
SpecT |
parameters(java.lang.Iterable<? extends SpecParameter<?>> parameters) |
SpecT |
parametersAdd(java.lang.Iterable<? extends SpecParameter<?>> parameters)
adds the given parameters, new ones first so they dominate subsequent ones
|
SpecT |
parametersReplace(java.lang.Iterable<? extends SpecParameter<?>> parameters)
replaces parameters with the given
|
<V> SpecT |
removeConfig(ConfigKey<V> key) |
<V> SpecT |
removeFlag(java.lang.String key) |
SpecT |
stackCatalogItemId(java.lang.String val)
Adds (stacks) the catalog item id of a wrapping specification.
|
SpecT |
tag(java.lang.Object tag) |
SpecT |
tags(java.lang.Iterable<? extends java.lang.Object> tagsToAdd)
adds the given tags
|
SpecT |
tagsAdd(java.lang.Iterable<? extends java.lang.Object> tagsToAdd)
adds the given tags
|
SpecT |
tagsReplace(java.lang.Iterable<? extends java.lang.Object> tagsToReplace)
replaces tags with the given
|
java.lang.String |
toString() |
public java.lang.String toString()
toString
in class java.lang.Object
public SpecT displayName(java.lang.String val)
public SpecT catalogItemId(java.lang.String val)
catalogItemIdAndSearchPath(java.lang.String, java.util.Collection<java.lang.String>)
.public SpecT catalogItemIdAndSearchPath(java.lang.String catalogItemId, java.util.Collection<java.lang.String> searchPath)
public SpecT addSearchPath(java.util.List<java.lang.String> searchPath)
@Deprecated public SpecT catalogItemIdIfNotNull(java.lang.String val)
stackCatalogItemId(String)
instead, though semantics are differentpublic SpecT stackCatalogItemId(java.lang.String val)
Used when we want to collect IDs of items that extend other items, so that *all* can be searched. e.g. if R3 extends R2 which extends R1 any one of these might supply config keys referencing resources or types in their local bundles.
public SpecT tag(java.lang.Object tag)
public SpecT tags(java.lang.Iterable<? extends java.lang.Object> tagsToAdd)
public SpecT tagsAdd(java.lang.Iterable<? extends java.lang.Object> tagsToAdd)
public SpecT tagsReplace(java.lang.Iterable<? extends java.lang.Object> tagsToReplace)
public SpecT parameters(java.lang.Iterable<? extends SpecParameter<?>> parameters)
public SpecT parametersAdd(java.lang.Iterable<? extends SpecParameter<?>> parameters)
public SpecT parametersReplace(java.lang.Iterable<? extends SpecParameter<?>> parameters)
public java.lang.Class<? extends T> getType()
public final java.lang.String getDisplayName()
public final java.lang.String getCatalogItemId()
BrooklynObject.getCatalogItemId()
.public final java.util.List<java.lang.String> getCatalogItemIdSearchPath()
public final java.util.Set<java.lang.Object> getTags()
public final java.util.List<SpecParameter<?>> getParameters()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public SpecT configure(java.util.Map<?,?> val)
public SpecT configure(java.lang.CharSequence key, java.lang.Object val)
public <V> SpecT configure(ConfigKey.HasConfigKey<V> key, V val)
public <V> SpecT configure(ConfigKey.HasConfigKey<V> key, Task<? extends V> val)
public <V> SpecT removeFlag(java.lang.String key)
public void clearConfig()
public java.util.Map<java.lang.String,?> getFlags()
declarations on the policy type
public java.util.Map<ConfigKey<?>,java.lang.Object> getConfig()