Class EntityBuilder


  • public class EntityBuilder
    extends java.lang.Object
    • Constructor Detail

      • EntityBuilder

        public EntityBuilder()
    • Method Detail

      • setType

        public EntityBuilder setType​(org.eebus.docs.spine.xsd.v1.EntityTypeEnumType entityType)
        This method must be called before calling applyToDevice(), applyToEntity() or build()!
        Parameters:
        entityType - the type of the SPINE entity
        Returns:
        the updated EntityBuilder
      • addEntity

        public EntityBuilder addEntity()
        Creates a new EntityBuilder instance. The sub-entity can then be fluently added to this entity with applyToEntity()
        Returns:
        a new EntityBuilder instance
      • addFeature

        public FeatureBuilder addFeature()
        Creates a new FeatureBuilder instance. The feature can then be fluently added to this entity with FeatureBuilder.apply().
        Returns:
        a new FeatureBuilder instance
      • setDescription

        public EntityBuilder setDescription​(java.lang.String description)
        Parameters:
        description - a string describing the new SPINE entity
        Returns:
        the updated EntityBuilder
      • setLabel

        public EntityBuilder setLabel​(java.lang.String label)
        Parameters:
        label - a human-readable alias of the new SPINE entity
        Returns:
        the updated EntityBuilder
      • applyToEntity

        public EntityBuilder applyToEntity()
        Builds this entity and adds it to the parent entity.
        If this EntityBuilder was not created from another EntityBuilder this throws UnsupportedOperationException.
        If mandatory information was not set (setType(EntityTypeEnumType)) this operation throws an IncompleteBuildException.
        Returns:
        the updated parent EntityBuilder
      • applyToDevice

        public DeviceBuilder applyToDevice()
        Builds this entity and adds it to the parent device.
        If this EntityBuilder was not created from a DeviceBuilder this throws UnsupportedOperationException.
        If mandatory information was not set (setType(EntityTypeEnumType)) this operation throws an IncompleteBuildException.
        Returns:
        the updated parent DeviceBuilder