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 DtSketchBuilder
addComputedField(String fieldName, String label, DomainSketch domainSketch, io.vertigo.core.lang.Cardinality cardinality, ComputedExpression computedExpression)
Adds a computed field.DtSketchBuilder
addDataField(String fieldName, String label, DomainSketch domainSketch, io.vertigo.core.lang.Cardinality cardinality, boolean persistent)
Adds a common data field.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).DtSketchBuilder
addIdField(String fieldName, String label, DomainSketch domainSketch)
Adds an ID field.DtSketch
build()
DtSketchBuilder
withDataSpace(String dataSpace)
Sets the dataSpace to which the dtSketch belongs.DtSketchBuilder
withDisplayField(String displayFieldName)
Specifies which field to be used for displayDtSketchBuilder
withFragment(DtSketch fragment)
Sets fragmentDtSketchBuilder
withHandleField(String handleFieldName)
Specifies which field to be used for handleDtSketchBuilder
withKeyField(String keyFieldName)
Specifies which field to be used for key to distinguish elements in a collectionDtSketchBuilder
withPackageName(String packageName)
Sets packageNameDtSketchBuilder
withSortField(String sortFieldName)
Specifies which field to be used for sortingDtSketchBuilder
withStereoType(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
-
-