Class CompositeDataTypeCreator
- java.lang.Object
-
- org.palladiosimulator.generator.fluent.shared.structure.Entity
-
- org.palladiosimulator.generator.fluent.repository.structure.RepositoryEntity
-
- org.palladiosimulator.generator.fluent.repository.structure.types.CompositeDataTypeCreator
-
public class CompositeDataTypeCreator extends RepositoryEntity
This class constructs aCompositeDataType
. It is used to create the 'CompositeDataType' object step-by-step, i.e. 'CompositeDataTypeCreator' objects are of intermediate state.- See Also:
CompositeDataType
-
-
Field Summary
-
Fields inherited from class org.palladiosimulator.generator.fluent.repository.structure.RepositoryEntity
repository
-
-
Constructor Summary
Constructors Constructor Description CompositeDataTypeCreator(RepositoryCreator repo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.palladiosimulator.pcm.repository.CompositeDataType
build()
Turns the entity in the making into the finished entity.CompositeDataTypeCreator
withInnerDeclaration(String name, Primitive primitive)
Adds an inner data type to a composite data type with namename
and of typeprimitive
.CompositeDataTypeCreator
withInnerDeclaration(String name, org.palladiosimulator.pcm.repository.DataType dataType)
Adds an inner data type to a composite data type with namename
and of typedataType
.CompositeDataTypeCreator
withName(String name)
Defines the unique name of this current entity.CompositeDataTypeCreator
withParentCompositeDataType(org.palladiosimulator.pcm.repository.CompositeDataType parent)
Addsparent
to the list of parents this composite data type inherits from.
-
-
-
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.
-
withInnerDeclaration
public CompositeDataTypeCreator withInnerDeclaration(String name, Primitive primitive)
Adds an inner data type to a composite data type with namename
and of typeprimitive
.This corresponds to the declaration of fields in a Java class. For example
.withInnerDeclaration("age", Primitive.INTEGER)
conforms withpublic int age;
.- Parameters:
name
- for the inner data typeprimitive
- 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 namename
and of typedataType
.This corresponds to the declaration of fields in a Java class. For example
.withInnerDeclaration("age", Primitive.INTEGER)
conforms withpublic int age;
.
Non primitive data types can be fetched from the repository using the methodfetchOfDataType(String)
.- Parameters:
name
- for the inner data typedataType
- 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)
Addsparent
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
-
-