Package org.openmuc.jeebus.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 intaddFeature(Feature feature)Adds a feature to this entity at runtime.voiddeleteFeature(int address)org.openmuc.jeebus.spine.xsd.v1.EntityAddressTypegetAddress()Returns the complete address of this entity, its parent entities and device.static EntityBuildergetBuilder()The returned builder builds a SPINE entity which can be added to an existing SPINE device at runtime withEntityParent.addEntity(Entity).java.lang.StringgetDescription()FeaturegetFeature(int address)java.util.Collection<Feature>getFeatures()java.lang.StringgetLabel()org.openmuc.jeebus.spine.xsd.v1.EntityAddressTypegetStaticAddress()Returns the address of this entity relative to the parent device.org.openmuc.jeebus.spine.xsd.v1.EntityTypeEnumTypegetType()booleanhasDescription()booleanhasLabel()-
Methods inherited from interface org.openmuc.jeebus.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
EntityBuilderobject to create a new SPINE entity
-
getStaticAddress
org.openmuc.jeebus.spine.xsd.v1.EntityAddressType getStaticAddress()
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
-
getAddress
org.openmuc.jeebus.spine.xsd.v1.EntityAddressType getAddress()
Returns the complete address of this entity, its parent entities and device.
The list returned byEntityAddressType.getEntity()contains the address parts of all entity parents in order- Returns:
- the entity address
-
getType
org.openmuc.jeebus.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 theNodeManagementinstance 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
-
-