Class DtSketchBuilder
- java.lang.Object
-
- io.vertigo.studio.notebook.domain.DtSketchBuilder
-
- All Implemented Interfaces:
io.vertigo.core.lang.Builder<DtSketch>
public final class DtSketchBuilder extends Object implements io.vertigo.core.lang.Builder<DtSketch>
This class must be used to build a DtSketch. Each dtSketch must have a name following this pattern DT_XXX_YYYY- Author:
- pchretien, mlaroche
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DtSketchBuilderaddComputedField(String fieldName, String label, DomainSketch domainSketch, io.vertigo.core.lang.Cardinality cardinality, ComputedExpression computedExpression)Adds a computed field.DtSketchBuilderaddDataField(String fieldName, String label, DomainSketch domainSketch, io.vertigo.core.lang.Cardinality cardinality, boolean persistent)Adds a common data field.DtSketchBuilderaddForeignKey(String fieldName, String label, DomainSketch domainSketch, io.vertigo.core.lang.Cardinality cardinality, String fkDtSketchName)Adds a field linked to another dtSketch (aka foreign key).DtSketchBuilderaddIdField(String fieldName, String label, DomainSketch domainSketch)Adds an ID field.DtSketchbuild()DtSketchBuilderwithDataSpace(String dataSpace)Sets the dataSpace to which the dtSketch belongs.DtSketchBuilderwithDisplayField(String displayFieldName)Specifies which field to be used for displayDtSketchBuilderwithFragment(DtSketch fragment)Sets fragmentDtSketchBuilderwithHandleField(String handleFieldName)Specifies which field to be used for handleDtSketchBuilderwithKeyField(String keyFieldName)Specifies which field to be used for key to distinguish elements in a collectionDtSketchBuilderwithPackageName(String packageName)Sets packageNameDtSketchBuilderwithSortField(String sortFieldName)Specifies which field to be used for sortingDtSketchBuilderwithStereoType(StudioStereotype stereotype)Sets the stereotype of the dtSketch.
-
-
-
Method Detail
-
withPackageName
public DtSketchBuilder withPackageName(String packageName)
Sets packageName- Parameters:
packageName- the name of the package (nullable)- Returns:
- this builder
-
withFragment
public DtSketchBuilder withFragment(DtSketch fragment)
Sets fragment- Parameters:
fragment- Persistent root DtSketch for this fragment- Returns:
- this builder
-
withStereoType
public DtSketchBuilder withStereoType(StudioStereotype stereotype)
Sets the stereotype of the dtSketch.- Parameters:
stereotype- the stereotype of the dtSketch- Returns:
- this builder
-
addForeignKey
public DtSketchBuilder addForeignKey(String fieldName, String label, DomainSketch domainSketch, io.vertigo.core.lang.Cardinality cardinality, String fkDtSketchName)
Adds a field linked to another dtSketch (aka foreign key).- Parameters:
fieldName- the name of the fieldfkDtSketchName- the name of the linked definitionlabel- the label of the fielddomainSketch- the domain of the fieldrequired- if the field is required- Returns:
- this builder
-
addComputedField
public DtSketchBuilder addComputedField(String fieldName, String label, DomainSketch domainSketch, io.vertigo.core.lang.Cardinality cardinality, ComputedExpression computedExpression)
Adds a computed field.- Parameters:
fieldName- the name of the fieldlabel- the label of the fielddomainSketch- the domain of the fieldcomputedExpression- the expression use to compute the field- Returns:
- this builder
-
addDataField
public DtSketchBuilder addDataField(String fieldName, String label, DomainSketch domainSketch, io.vertigo.core.lang.Cardinality cardinality, boolean persistent)
Adds a common data field.- Parameters:
fieldName- the name of the fielddomainSketch- the domain of the fieldlabel- the label of the fieldrequired- if the field is requiredpersistent- if the fiels is persistent- Returns:
- this builder
-
addIdField
public DtSketchBuilder addIdField(String fieldName, String label, DomainSketch domainSketch)
Adds an ID field. This field is required.- Parameters:
fieldName- the name of the fielddomainSketch- the domain of the fieldlabel- the label of the field- Returns:
- this builder
-
withDataSpace
public DtSketchBuilder withDataSpace(String dataSpace)
Sets the dataSpace to which the dtSketch belongs.- Parameters:
dataSpace- the dataSpace to which the DtSketch is mapped.- Returns:
- this builder
-
withSortField
public DtSketchBuilder withSortField(String sortFieldName)
Specifies which field to be used for sorting- Parameters:
sortFieldName- fieldName to use- Returns:
- this builder
-
withDisplayField
public DtSketchBuilder withDisplayField(String displayFieldName)
Specifies which field to be used for display- Parameters:
displayFieldName- fieldName to use- Returns:
- this builder
-
withHandleField
public DtSketchBuilder withHandleField(String handleFieldName)
Specifies which field to be used for handle- Parameters:
handleFieldName- fieldName to use- Returns:
- this builder
-
withKeyField
public DtSketchBuilder withKeyField(String keyFieldName)
Specifies which field to be used for key to distinguish elements in a collection- Parameters:
keyFieldName- fieldName to use- Returns:
- this builder
-
-