Class ImmutableGwtScenarioDto.Builder
- java.lang.Object
-
- com.chutneytesting.scenario.api.raw.dto.ImmutableGwtScenarioDto.Builder
-
- Enclosing class:
- ImmutableGwtScenarioDto
@NotThreadSafe public static final class ImmutableGwtScenarioDto.Builder extends Object
Builds instances of typeImmutableGwtScenarioDto. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableGwtScenarioDto.Builder from(GwtScenarioDto instance)
Fill a builder with attribute values from the providedGwtScenarioDtoinstance. 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:
thisbuilder for use in a chained invocation
-
addGivens
@CanIgnoreReturnValue public final ImmutableGwtScenarioDto.Builder addGivens(GwtStepDto element)
Adds one element togivenslist.- Parameters:
element- A givens element- Returns:
thisbuilder for use in a chained invocation
-
addGivens
@CanIgnoreReturnValue public final ImmutableGwtScenarioDto.Builder addGivens(GwtStepDto... elements)
Adds elements togivenslist.- Parameters:
elements- An array of givens elements- Returns:
thisbuilder for use in a chained invocation
-
givens
@CanIgnoreReturnValue public final ImmutableGwtScenarioDto.Builder givens(Iterable<? extends GwtStepDto> elements)
Sets or replaces all elements forgivenslist.- Parameters:
elements- An iterable of givens elements- Returns:
thisbuilder for use in a chained invocation
-
addAllGivens
@CanIgnoreReturnValue public final ImmutableGwtScenarioDto.Builder addAllGivens(Iterable<? extends GwtStepDto> elements)
Adds elements togivenslist.- Parameters:
elements- An iterable of givens elements- Returns:
thisbuilder for use in a chained invocation
-
when
@CanIgnoreReturnValue public final ImmutableGwtScenarioDto.Builder when(GwtStepDto when)
Initializes the value for thewhenattribute.- Parameters:
when- The value for when- Returns:
thisbuilder for use in a chained invocation
-
addThens
@CanIgnoreReturnValue public final ImmutableGwtScenarioDto.Builder addThens(GwtStepDto element)
Adds one element tothenslist.- Parameters:
element- A thens element- Returns:
thisbuilder for use in a chained invocation
-
addThens
@CanIgnoreReturnValue public final ImmutableGwtScenarioDto.Builder addThens(GwtStepDto... elements)
Adds elements tothenslist.- Parameters:
elements- An array of thens elements- Returns:
thisbuilder for use in a chained invocation
-
thens
@CanIgnoreReturnValue public final ImmutableGwtScenarioDto.Builder thens(Iterable<? extends GwtStepDto> elements)
Sets or replaces all elements forthenslist.- Parameters:
elements- An iterable of thens elements- Returns:
thisbuilder for use in a chained invocation
-
addAllThens
@CanIgnoreReturnValue public final ImmutableGwtScenarioDto.Builder addAllThens(Iterable<? extends GwtStepDto> elements)
Adds elements tothenslist.- Parameters:
elements- An iterable of thens elements- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableGwtScenarioDto build()
Builds a newImmutableGwtScenarioDto.- Returns:
- An immutable instance of GwtScenarioDto
- Throws:
IllegalStateException- if any required attributes are missing
-
-