Class ImmutableGwtScenarioDto.Builder
java.lang.Object
com.chutneytesting.scenario.api.raw.dto.ImmutableGwtScenarioDto.Builder
- Enclosing class:
- ImmutableGwtScenarioDto
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 Summary
Modifier and TypeMethodDescriptionaddAllGivens(Iterable<? extends GwtStepDto> elements) Adds elements togivenslist.addAllThens(Iterable<? extends GwtStepDto> elements) Adds elements tothenslist.addGivens(GwtStepDto element) Adds one element togivenslist.addGivens(GwtStepDto... elements) Adds elements togivenslist.addThens(GwtStepDto element) Adds one element tothenslist.addThens(GwtStepDto... elements) Adds elements tothenslist.build()Builds a newImmutableGwtScenarioDto.from(GwtScenarioDto instance) Fill a builder with attribute values from the providedGwtScenarioDtoinstance.givens(Iterable<? extends GwtStepDto> elements) Sets or replaces all elements forgivenslist.thens(Iterable<? extends GwtStepDto> elements) Sets or replaces all elements forthenslist.when(GwtStepDto when) Initializes the value for thewhenattribute.
-
Method Details
-
from
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
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
Initializes the value for thewhenattribute.- Parameters:
when- The value for when- Returns:
thisbuilder for use in a chained invocation
-
addThens
Adds one element tothenslist.- Parameters:
element- A thens element- Returns:
thisbuilder for use in a chained invocation
-
addThens
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
Builds a newImmutableGwtScenarioDto.- Returns:
- An immutable instance of GwtScenarioDto
- Throws:
IllegalStateException- if any required attributes are missing
-