Class CompositeDataTypeCreator


  • public class CompositeDataTypeCreator
    extends RepositoryEntity
    This class constructs a CompositeDataType. It is used to create the 'CompositeDataType' object step-by-step, i.e. 'CompositeDataTypeCreator' objects are of intermediate state.
    See Also:
    CompositeDataType
    • Constructor Detail

      • CompositeDataTypeCreator

        public CompositeDataTypeCreator​(RepositoryCreator repo)
    • Method Detail

      • withName

        public CompositeDataTypeCreator withName​(String name)
        Description copied from class: Entity
        Defines the unique name of this current entity. Once created entities are referenced by this name. Only entities with a unique name can be fetched from the model.
        Overrides:
        withName in class Entity
        Returns:
        this current entity in the making
      • withInnerDeclaration

        public CompositeDataTypeCreator withInnerDeclaration​(String name,
                                                             Primitive primitive)
        Adds an inner data type to a composite data type with name name and of type primitive.

        This corresponds to the declaration of fields in a Java class. For example .withInnerDeclaration("age", Primitive.INTEGER) conforms with public int age;.

        Parameters:
        name - for the inner data type
        primitive - inner data type
        Returns:
        this composite data type in the making
        See Also:
        CompositeDataType
      • withInnerDeclaration

        public CompositeDataTypeCreator withInnerDeclaration​(String name,
                                                             org.palladiosimulator.pcm.repository.DataType dataType)
        Adds an inner data type to a composite data type with name name and of type dataType.

        This corresponds to the declaration of fields in a Java class. For example .withInnerDeclaration("age", Primitive.INTEGER) conforms with public int age;.
        Non primitive data types can be fetched from the repository using the method fetchOfDataType(String).

        Parameters:
        name - for the inner data type
        dataType - inner data type
        Returns:
        this composite data type in the making
        See Also:
        FluentRepositoryFactory.fetchOfDataType(String), CompositeDataType
      • withParentCompositeDataType

        public CompositeDataTypeCreator withParentCompositeDataType​(org.palladiosimulator.pcm.repository.CompositeDataType parent)
        Adds parent to the list of parents this composite data type inherits from.

        An existing composite data type can be fetched from the repository using the org.palladiosimulator.generator.fluent.component.factory, i.e. create.fetchOfCompleteComponentType(name).

        Parameters:
        parent -
        Returns:
        this composite data type in the making
        See Also:
        org.palladiosimulator.generator.fluent.repository.factory.FluentRepositoryFactory#fetchOfComposite, CompositeDataType
      • build

        public org.palladiosimulator.pcm.repository.CompositeDataType build()
        Description copied from class: Entity
        Turns the entity in the making into the finished entity.
        Specified by:
        build in class Entity
        Returns:
        the finished entity