Package io.resys.hdes.client.api.ast
Class ImmutableCommandsAndChanges.Builder
java.lang.Object
io.resys.hdes.client.api.ast.ImmutableCommandsAndChanges.Builder
- Enclosing class:
- ImmutableCommandsAndChanges
Builds instances of type
ImmutableCommandsAndChanges.
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 TypeMethodDescriptionaddAllCommands(Iterable<? extends AstCommand> elements) Adds elements tocommandslist.addAllSrc(Iterable<? extends AstChangeset> elements) Adds elements tosrclist.addCommands(AstCommand element) Adds one element tocommandslist.addCommands(AstCommand... elements) Adds elements tocommandslist.addSrc(AstChangeset element) Adds one element tosrclist.addSrc(AstChangeset... elements) Adds elements tosrclist.build()Builds a newImmutableCommandsAndChanges.commands(Iterable<? extends AstCommand> elements) Sets or replaces all elements forcommandslist.from(AstChangeset.CommandsAndChanges instance) Fill a builder with attribute values from the providedCommandsAndChangesinstance.src(Iterable<? extends AstChangeset> elements) Sets or replaces all elements forsrclist.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableCommandsAndChanges.Builder from(AstChangeset.CommandsAndChanges instance) Fill a builder with attribute values from the providedCommandsAndChangesinstance. 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
-
addCommands
@CanIgnoreReturnValue public final ImmutableCommandsAndChanges.Builder addCommands(AstCommand element) Adds one element tocommandslist.- Parameters:
element- A commands element- Returns:
thisbuilder for use in a chained invocation
-
addCommands
@CanIgnoreReturnValue public final ImmutableCommandsAndChanges.Builder addCommands(AstCommand... elements) Adds elements tocommandslist.- Parameters:
elements- An array of commands elements- Returns:
thisbuilder for use in a chained invocation
-
commands
@CanIgnoreReturnValue public final ImmutableCommandsAndChanges.Builder commands(Iterable<? extends AstCommand> elements) Sets or replaces all elements forcommandslist.- Parameters:
elements- An iterable of commands elements- Returns:
thisbuilder for use in a chained invocation
-
addAllCommands
@CanIgnoreReturnValue public final ImmutableCommandsAndChanges.Builder addAllCommands(Iterable<? extends AstCommand> elements) Adds elements tocommandslist.- Parameters:
elements- An iterable of commands elements- Returns:
thisbuilder for use in a chained invocation
-
addSrc
Adds one element tosrclist.- Parameters:
element- A src element- Returns:
thisbuilder for use in a chained invocation
-
addSrc
@CanIgnoreReturnValue public final ImmutableCommandsAndChanges.Builder addSrc(AstChangeset... elements) Adds elements tosrclist.- Parameters:
elements- An array of src elements- Returns:
thisbuilder for use in a chained invocation
-
src
@CanIgnoreReturnValue public final ImmutableCommandsAndChanges.Builder src(Iterable<? extends AstChangeset> elements) Sets or replaces all elements forsrclist.- Parameters:
elements- An iterable of src elements- Returns:
thisbuilder for use in a chained invocation
-
addAllSrc
@CanIgnoreReturnValue public final ImmutableCommandsAndChanges.Builder addAllSrc(Iterable<? extends AstChangeset> elements) Adds elements tosrclist.- Parameters:
elements- An iterable of src elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableCommandsAndChanges.- Returns:
- An immutable instance of CommandsAndChanges
- Throws:
IllegalStateException- if any required attributes are missing
-