Package org.openmuc.eebus.spine.api
Interface Entity
-
- All Superinterfaces:
EntityParent
public interface Entity extends EntityParent
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description int
addFeature(Feature feature)
Adds a feature to this entity at runtime.void
deleteFeature(int address)
org.eebus.docs.spine.xsd.v1.EntityAddressType
getAddress()
Returns the address of this entity relative to the parent device.static EntityBuilder
getBuilder()
The returned builder builds a SPINE entity which can be added to an existing SPINE device at runtime withEntityParent.addEntity(Entity)
.java.lang.String
getDescription()
Feature
getFeature(int address)
java.util.Collection<Feature>
getFeatures()
java.lang.String
getLabel()
org.eebus.docs.spine.xsd.v1.EntityTypeEnumType
getType()
boolean
hasDescription()
boolean
hasLabel()
-
Methods inherited from interface org.openmuc.eebus.spine.api.EntityParent
addEntity, deleteEntity, getDevice, getEntities, getEntity, getParent, isDevice
-
-
-
-
Method Detail
-
getBuilder
static EntityBuilder getBuilder()
The returned builder builds a SPINE entity which can be added to an existing SPINE device at runtime withEntityParent.addEntity(Entity)
.
This method shall not be used to set up a device with an entity. For this purposeDeviceBuilder.addEntity()
shall be used.- Returns:
- a new
EntityBuilder
object to create a new SPINE entity
-
getAddress
org.eebus.docs.spine.xsd.v1.EntityAddressType getAddress()
Returns the address of this entity relative to the parent device.
The list returned byEntityAddressType.getEntity()
contains the address parts of all entity parents in order- Returns:
- the entity address
-
getType
org.eebus.docs.spine.xsd.v1.EntityTypeEnumType getType()
- Returns:
- the type of this entity
-
hasDescription
boolean hasDescription()
- Returns:
- true if this entity has a description set and false otherwise
-
hasLabel
boolean hasLabel()
- Returns:
- true if this entity has a label set and false otherwise
-
getDescription
java.lang.String getDescription()
- Returns:
- the description set or the empty string if no label was set
-
addFeature
int addFeature(Feature feature)
Adds a feature to this entity at runtime. After the feature was added theNodeManagement
instance notifies subscribers about the change.- Parameters:
feature
- the feature built withFeature.getBuilder()
- Returns:
- the feature address part of the added feature
-
getFeature
Feature getFeature(int address) throws SpineException
- Parameters:
address
- the feature address part of the feature addressFeatureAddressType.getFeature()
. Note that this implementation limits feature addresses toInteger.MAX_VALUE
- Returns:
- the feature with the given address
- Throws:
SpineException
- when no feature with the given address exists
-
deleteFeature
void deleteFeature(int address) throws SpineException
- Parameters:
address
- the feature address part of the feature addressFeatureAddressType.getFeature()
. Note that this implementation limits feature addresses toInteger.MAX_VALUE
- Throws:
SpineException
- when no feature with the given address exists
-
getFeatures
java.util.Collection<Feature> getFeatures()
- Returns:
- all features of this entity excluding features of sub-entities
-
getLabel
java.lang.String getLabel()
- Returns:
- the label set or the empty string if no label was set
-
-