org.springframework.cloud.dataflow.core

## Class TaskDefinition.TaskDefinitionBuilder

- java.lang.Object
- - org.springframework.cloud.dataflow.core.TaskDefinition.TaskDefinitionBuilder

- Enclosing class:
    TaskDefinition

      public static class TaskDefinition.TaskDefinitionBuilder
      extends Object

  Builder object for `TaskDefinition`. This object is mutable to allow for flexibility in specifying application fields/properties during parsing.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TaskDefinitionBuilder()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `TaskDefinition.TaskDefinitionBuilder` | `addProperties(Map<String,String> properties)` Add the contents of the provided map to the map of app properties.
    `TaskDefinition` | `build()` Return a new instance of `TaskDefinition`.
    `static TaskDefinition.TaskDefinitionBuilder` | `from(org.springframework.cloud.dataflow.core.DataFlowAppDefinition definition)` Create a new builder that is initialized with properties of the given definition.
    `String` | `getLabel()` Return symbolic name of a task.
    `Map<String,String>` | `getProperties()` Return properties for the task.
    `String` | `getRegisteredAppName()` Return name of task app in registry.
    `TaskDefinition.TaskDefinitionBuilder` | `setDslText(String dslText)` Establish the DSL Text for a task definition.
    `TaskDefinition.TaskDefinitionBuilder` | `setLabel(String label)` Set the app label.
    `TaskDefinition.TaskDefinitionBuilder` | `setProperties(Map<String,String> properties)` Sets the contents of the provided map as the map of app properties.
    `TaskDefinition.TaskDefinitionBuilder` | `setProperty(String name, String value)` Set an app property.
    `TaskDefinition.TaskDefinitionBuilder` | `setRegisteredAppName(String registeredAppName)` Set the name of the app in the registry.
    `TaskDefinition.TaskDefinitionBuilder` | `setTaskName(String taskName)` Establish the task name for a task definition.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TaskDefinitionBuilder

          public TaskDefinitionBuilder()

  - ### Method Detail

    - #### from

          public static TaskDefinition.TaskDefinitionBuilder from(org.springframework.cloud.dataflow.core.DataFlowAppDefinition definition)

      Create a new builder that is initialized with properties of the given definition. Useful for "mutating" a definition by building a slightly different copy.
      Parameters:
        `definition` - the DataFlowAppDefinition to use when creating the builder
      Returns:
        a task definition builder

    - #### setProperty

          public TaskDefinition.TaskDefinitionBuilder setProperty(String name,
                                                                  String value)

      Set an app property.
      Parameters:
        `name` - property name
        `value` - property value
      Returns:
        this builder object
      See Also:
        `AppDefinition.getProperties()`

    - #### setDslText

          public TaskDefinition.TaskDefinitionBuilder setDslText(String dslText)

      Establish the DSL Text for a task definition.
      Parameters:
        `dslText` - the dsl to be used by the TaskDefinition
      Returns:
        this builder object
      Since:
        2.3

    - #### setTaskName

          public TaskDefinition.TaskDefinitionBuilder setTaskName(String taskName)

      Establish the task name for a task definition.
      Parameters:
        `taskName` - the name to be used by the TaskDefinition
      Returns:
        this builder object
      Since:
        2.3
      See Also:
        `AppDefinition.getProperties()`

    - #### addProperties

          public TaskDefinition.TaskDefinitionBuilder addProperties(Map<String,String> properties)

      Add the contents of the provided map to the map of app properties.
      Parameters:
        `properties` - app properties
      Returns:
        this builder object
      See Also:
        `AppDefinition.getProperties()`

    - #### getRegisteredAppName

          public String getRegisteredAppName()

      Return name of task app in registry.
      Returns:
        task app name in registry

    - #### setRegisteredAppName

          public TaskDefinition.TaskDefinitionBuilder setRegisteredAppName(String registeredAppName)

      Set the name of the app in the registry.
      Parameters:
        `registeredAppName` - name of app in registry
      Returns:
        this builder object
      See Also:
        `DataFlowAppDefinition.registeredAppName`

    - #### getLabel

          public String getLabel()

      Return symbolic name of a task. If not provided, it will be the same as the task name.
      Returns:
        app label

    - #### setLabel

          public TaskDefinition.TaskDefinitionBuilder setLabel(String label)

      Set the app label.
      Parameters:
        `label` - name of app label
      Returns:
        this builder object

    - #### getProperties

          public Map<String,String> getProperties()

      Return properties for the task. Note that the contents of this map are mutable.
      Returns:
        map of app properties

    - #### setProperties

          public TaskDefinition.TaskDefinitionBuilder setProperties(Map<String,String> properties)

      Sets the contents of the provided map as the map of app properties.
      Parameters:
        `properties` - app properties
      Returns:
        this builder object
      See Also:
        `AppDefinition.getProperties()`

    - #### build

          public TaskDefinition build()

      Return a new instance of `TaskDefinition`.
      Returns:
        new instance of `TaskDefinition`

Copyright © 2021 Pivotal Software, Inc.. All rights reserved.