Class DslEntityBuilder

  • All Implemented Interfaces:
    io.vertigo.core.lang.Builder<DslEntity>

    public final class DslEntityBuilder
    extends Object
    implements io.vertigo.core.lang.Builder<DslEntity>
    This class provides a common way to build an entity.
    Author:
    pchretien, mlaroche
    • Method Detail

      • withProvided

        public DslEntityBuilder withProvided()
        Set this entity as core and managed specificaly.
        Returns:
        this builder
      • addRequiredField

        public DslEntityBuilder addRequiredField​(String fieldName,
                                                 DslEntityFieldType type)
        Adds a new simple REQUIRED field.
        Parameters:
        fieldName - the name of the field
        type - the type of the field
        Returns:
        this builder
      • addOptionalField

        public DslEntityBuilder addOptionalField​(String fieldName,
                                                 DslEntityFieldType type)
        Adds a new simple OPTIONAL field.
        Parameters:
        fieldName - the name of the field
        type - the type of the field
        Returns:
        this builder
      • addManyFields

        public DslEntityBuilder addManyFields​(String fieldName,
                                              DslEntity entity)
        Adds a new multi field defined by an entity.
        Parameters:
        fieldName - the name of the field
        entity - Type of the field
        Returns:
        this builder
      • addManyFields

        public DslEntityBuilder addManyFields​(String fieldName,
                                              DslEntityLink entityLink)
        Adds a new multi field defined by an entity.
        Parameters:
        fieldName - the name of the field
        entityLink - Type of the field
        Returns:
        this builder
      • build

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