T
- The type of entity to be createdpublic class EntitySpec<T extends Entity> extends AbstractBrooklynObjectSpec<T,EntitySpec<T>>
create(Class)
etc.
Users who need to implement this are strongly encouraged to extend
EntitySpec
.Constructor and Description |
---|
EntitySpec(java.lang.Class<T> type) |
Modifier and Type | Method and Description |
---|---|
EntitySpec<T> |
addInitializer(java.lang.Class<? extends EntityInitializer> initializerType)
The supplied class must have a public no-arg constructor.
|
EntitySpec<T> |
addInitializer(EntityInitializer initializer) |
EntitySpec<T> |
addInitializers(java.lang.Iterable<? extends EntityInitializer> initializers) |
EntitySpec<T> |
additionalInterfaces(java.lang.Class<?>... vals) |
EntitySpec<T> |
additionalInterfaces(java.lang.Iterable<java.lang.Class<?>> val) |
EntitySpec<T> |
child(EntitySpec<?> child)
The supplied class must have a public no-arg constructor.
|
EntitySpec<T> |
children(java.lang.Iterable<? extends EntitySpec<?>> children) |
<V> EntitySpec<T> |
clearLocations()
clears locations defined in the spec
|
static <T extends Entity> |
create(java.lang.Class<T> type)
Creates a new
EntitySpec instance for an entity of the given type. |
static <T extends Entity,U extends T> |
create(java.lang.Class<T> type,
java.lang.Class<U> implType)
Creates a new
EntitySpec instance for an entity of the given type. |
static <T extends Entity> |
create(EntitySpec<T> spec)
Copies entity spec so its configuration can be overridden without modifying the
original entity spec.
|
static <T extends Entity> |
create(java.util.Map<?,?> config,
java.lang.Class<T> type)
Creates a new
EntitySpec instance with the given config, for an entity of the given type. |
<V> EntitySpec<T> |
enricher(EnricherSpec<?> val)
adds an enricher to the spec
|
<V> EntitySpec<T> |
enricherSpecs(java.lang.Iterable<? extends EnricherSpec<?>> val)
adds the supplied policies to the spec
|
java.util.Set<java.lang.Class<?>> |
getAdditionalInterfaces() |
java.util.List<EntitySpec<?>> |
getChildren() |
java.util.List<EnricherSpec<?>> |
getEnricherSpecs() |
java.util.List<Group> |
getGroups() |
java.lang.Class<? extends T> |
getImplementation() |
java.util.List<EntityInitializer> |
getInitializers() |
java.util.List<Location> |
getLocations()
Deprecated.
since 0.9.0 in future only
getLocationSpecs() will be supported |
java.util.List<LocationSpec<?>> |
getLocationSpecs() |
java.util.List<Entity> |
getMembers() |
Entity |
getParent() |
java.util.List<PolicySpec<?>> |
getPolicySpecs() |
java.lang.Class<T> |
getType() |
EntitySpec<T> |
group(Group group) |
EntitySpec<T> |
groups(java.lang.Iterable<? extends Group> groups) |
EntitySpec<T> |
immutable()
"seals" this spec, preventing any future changes
|
EntitySpec<T> |
impl(java.lang.Class<? extends T> val) |
<V> EntitySpec<T> |
location(Location val)
Deprecated.
since 0.9.0 pass a spec, using
location(LocationSpec) |
<V> EntitySpec<T> |
location(LocationSpec<?> val)
adds a location to the spec
|
<V> EntitySpec<T> |
locations(java.lang.Iterable<? extends Location> val)
Deprecated.
since 0.9.0 pass a spec, using
locationSpecs(Iterable) |
<V> EntitySpec<T> |
locationSpecs(java.lang.Iterable<? extends LocationSpec<?>> val)
adds the supplied locations to the spec
|
EntitySpec<T> |
member(Entity member) |
EntitySpec<T> |
members(java.lang.Iterable<? extends Entity> members) |
static <T extends Entity> |
newInstance(java.lang.Class<T> type) |
EntitySpec<T> |
parent(Entity val) |
<V> EntitySpec<T> |
policy(PolicySpec<?> val)
adds a policy to the spec
|
<V> EntitySpec<T> |
policySpecs(java.lang.Iterable<? extends PolicySpec<?>> val)
adds the supplied policies to the spec
|
addSearchPath, catalogItemId, catalogItemIdAndSearchPath, catalogItemIdIfNotNull, clearConfig, configure, configure, configure, configure, configure, configure, configureIfNotNull, displayName, equals, getCatalogItemId, getCatalogItemIdSearchPath, getConfig, getDisplayName, getFlags, getParameters, getTags, hashCode, parameters, parametersAdd, parametersReplace, removeConfig, removeFlag, stackCatalogItemId, tag, tags, tagsAdd, tagsReplace, toString
public EntitySpec(java.lang.Class<T> type)
public static <T extends Entity> EntitySpec<T> create(java.lang.Class<T> type)
EntitySpec
instance for an entity of the given type. The returned
EntitySpec
can then be customized.type
- An Entity
interfacepublic static <T extends Entity,U extends T> EntitySpec<T> create(java.lang.Class<T> type, java.lang.Class<U> implType)
EntitySpec
instance for an entity of the given type. The returned
EntitySpec
can then be customized.public static <T extends Entity> EntitySpec<T> create(java.util.Map<?,?> config, java.lang.Class<T> type)
EntitySpec
instance with the given config, for an entity of the given type.
This is primarily for groovy code; equivalent to EntitySpec.create(type).configure(config)
.config
- The spec's configuration (see AbstractBrooklynObjectSpec.configure(Map)
).type
- An Entity
interfacepublic static <T extends Entity> EntitySpec<T> create(EntitySpec<T> spec)
public static <T extends Entity> EntitySpec<T> newInstance(java.lang.Class<T> type)
public java.lang.Class<T> getType()
getType
in class AbstractBrooklynObjectSpec<T extends Entity,EntitySpec<T extends Entity>>
@Nullable public java.lang.Class<? extends T> getImplementation()
on the entity interface classes for how defaults are defined.
,
for how implementations can be defined globally
public java.util.Set<java.lang.Class<?>> getAdditionalInterfaces()
getType()
) that this entity implements;
important for when accessing entity through a proxy to determine which interfaces the proxy exposes.public java.util.List<EntityInitializer> getInitializers()
EntityInitializer
objects which customize the entity to be createdpublic java.util.List<EntitySpec<?>> getChildren()
public java.util.List<Entity> getMembers()
public java.util.List<Group> getGroups()
public Entity getParent()
public java.util.List<PolicySpec<?>> getPolicySpecs()
public java.util.List<EnricherSpec<?>> getEnricherSpecs()
public java.util.List<LocationSpec<?>> getLocationSpecs()
@Deprecated public java.util.List<Location> getLocations()
getLocationSpecs()
will be supportedpublic EntitySpec<T> impl(java.lang.Class<? extends T> val)
public EntitySpec<T> additionalInterfaces(java.lang.Class<?>... vals)
public EntitySpec<T> additionalInterfaces(java.lang.Iterable<java.lang.Class<?>> val)
public EntitySpec<T> addInitializer(EntityInitializer initializer)
public EntitySpec<T> addInitializers(java.lang.Iterable<? extends EntityInitializer> initializers)
public EntitySpec<T> addInitializer(java.lang.Class<? extends EntityInitializer> initializerType)
public EntitySpec<T> children(java.lang.Iterable<? extends EntitySpec<?>> children)
public EntitySpec<T> child(EntitySpec<?> child)
public EntitySpec<T> members(java.lang.Iterable<? extends Entity> members)
public EntitySpec<T> member(Entity member)
public EntitySpec<T> groups(java.lang.Iterable<? extends Group> groups)
public EntitySpec<T> group(Group group)
public EntitySpec<T> parent(Entity val)
public <V> EntitySpec<T> policy(PolicySpec<?> val)
public <V> EntitySpec<T> policySpecs(java.lang.Iterable<? extends PolicySpec<?>> val)
public <V> EntitySpec<T> enricher(EnricherSpec<?> val)
public <V> EntitySpec<T> enricherSpecs(java.lang.Iterable<? extends EnricherSpec<?>> val)
@Deprecated public <V> EntitySpec<T> location(Location val)
location(LocationSpec)
public <V> EntitySpec<T> location(LocationSpec<?> val)
public <V> EntitySpec<T> locationSpecs(java.lang.Iterable<? extends LocationSpec<?>> val)
@Deprecated public <V> EntitySpec<T> locations(java.lang.Iterable<? extends Location> val)
locationSpecs(Iterable)
public <V> EntitySpec<T> clearLocations()
public EntitySpec<T> immutable()