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 Details

    • 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 field
      label - the label of the field
      domainSketch - the domain of the field
      fkDtSketchName - the name of the linked definition
      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 field
      label - the label of the field
      domainSketch - the domain of the field
      computedExpression - 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 field
      label - the label of the field
      domainSketch - the domain of the field
      persistent - 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 field
      label - the label of the field
      domainSketch - the domain 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
    • build

      public DtSketch build()
      Specified by:
      build in interface io.vertigo.core.lang.Builder<DtSketch>