Class ImmutableGwtScenarioDto.Builder

java.lang.Object
fr.enedis.chutney.scenario.api.raw.dto.ImmutableGwtScenarioDto.Builder
Enclosing class:
ImmutableGwtScenarioDto

@Generated(from="GwtScenarioDto", generator="Immutables") @NotThreadSafe public static final class ImmutableGwtScenarioDto.Builder extends Object
Builds instances of type ImmutableGwtScenarioDto. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Method Details

    • from

      @CanIgnoreReturnValue public final ImmutableGwtScenarioDto.Builder from(GwtScenarioDto instance)
      Fill a builder with attribute values from the provided GwtScenarioDto instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • addGivens

      @CanIgnoreReturnValue public final ImmutableGwtScenarioDto.Builder addGivens(GwtStepDto element)
      Adds one element to givens list.
      Parameters:
      element - A givens element
      Returns:
      this builder for use in a chained invocation
    • addGivens

      @CanIgnoreReturnValue public final ImmutableGwtScenarioDto.Builder addGivens(GwtStepDto... elements)
      Adds elements to givens list.
      Parameters:
      elements - An array of givens elements
      Returns:
      this builder for use in a chained invocation
    • givens

      @CanIgnoreReturnValue public final ImmutableGwtScenarioDto.Builder givens(Iterable<? extends GwtStepDto> elements)
      Sets or replaces all elements for givens list.
      Parameters:
      elements - An iterable of givens elements
      Returns:
      this builder for use in a chained invocation
    • addAllGivens

      @CanIgnoreReturnValue public final ImmutableGwtScenarioDto.Builder addAllGivens(Iterable<? extends GwtStepDto> elements)
      Adds elements to givens list.
      Parameters:
      elements - An iterable of givens elements
      Returns:
      this builder for use in a chained invocation
    • when

      @CanIgnoreReturnValue public final ImmutableGwtScenarioDto.Builder when(GwtStepDto when)
      Initializes the value for the when attribute.
      Parameters:
      when - The value for when
      Returns:
      this builder for use in a chained invocation
    • addThens

      @CanIgnoreReturnValue public final ImmutableGwtScenarioDto.Builder addThens(GwtStepDto element)
      Adds one element to thens list.
      Parameters:
      element - A thens element
      Returns:
      this builder for use in a chained invocation
    • addThens

      @CanIgnoreReturnValue public final ImmutableGwtScenarioDto.Builder addThens(GwtStepDto... elements)
      Adds elements to thens list.
      Parameters:
      elements - An array of thens elements
      Returns:
      this builder for use in a chained invocation
    • thens

      @CanIgnoreReturnValue public final ImmutableGwtScenarioDto.Builder thens(Iterable<? extends GwtStepDto> elements)
      Sets or replaces all elements for thens list.
      Parameters:
      elements - An iterable of thens elements
      Returns:
      this builder for use in a chained invocation
    • addAllThens

      @CanIgnoreReturnValue public final ImmutableGwtScenarioDto.Builder addAllThens(Iterable<? extends GwtStepDto> elements)
      Adds elements to thens list.
      Parameters:
      elements - An iterable of thens elements
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableGwtScenarioDto build()
      Returns:
      An immutable instance of GwtScenarioDto
      Throws:
      IllegalStateException - if any required attributes are missing