Package io.thestencil.client.api
Class ImmutableBatchCommand.Builder
- java.lang.Object
-
- io.thestencil.client.api.ImmutableBatchCommand.Builder
-
- Enclosing class:
- ImmutableBatchCommand
@NotThreadSafe public static final class ImmutableBatchCommand.Builder extends Object
Builds instances of typeImmutableBatchCommand. 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 ImmutableBatchCommand.Builder from(StencilStore.BatchCommand instance)
Fill a builder with attribute values from the providedBatchCommandinstance. 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
-
addToBeCreated
@CanIgnoreReturnValue public final ImmutableBatchCommand.Builder addToBeCreated(StencilClient.Entity element)
Adds one element totoBeCreatedlist.- Parameters:
element- A toBeCreated element- Returns:
thisbuilder for use in a chained invocation
-
addToBeCreated
@CanIgnoreReturnValue public final ImmutableBatchCommand.Builder addToBeCreated(StencilClient.Entity... elements)
Adds elements totoBeCreatedlist.- Parameters:
elements- An array of toBeCreated elements- Returns:
thisbuilder for use in a chained invocation
-
toBeCreated
@CanIgnoreReturnValue public final ImmutableBatchCommand.Builder toBeCreated(Iterable<? extends StencilClient.Entity> elements)
Sets or replaces all elements fortoBeCreatedlist.- Parameters:
elements- An iterable of toBeCreated elements- Returns:
thisbuilder for use in a chained invocation
-
addAllToBeCreated
@CanIgnoreReturnValue public final ImmutableBatchCommand.Builder addAllToBeCreated(Iterable<? extends StencilClient.Entity> elements)
Adds elements totoBeCreatedlist.- Parameters:
elements- An iterable of toBeCreated elements- Returns:
thisbuilder for use in a chained invocation
-
addToBeSaved
@CanIgnoreReturnValue public final ImmutableBatchCommand.Builder addToBeSaved(StencilClient.Entity element)
Adds one element totoBeSavedlist.- Parameters:
element- A toBeSaved element- Returns:
thisbuilder for use in a chained invocation
-
addToBeSaved
@CanIgnoreReturnValue public final ImmutableBatchCommand.Builder addToBeSaved(StencilClient.Entity... elements)
Adds elements totoBeSavedlist.- Parameters:
elements- An array of toBeSaved elements- Returns:
thisbuilder for use in a chained invocation
-
toBeSaved
@CanIgnoreReturnValue public final ImmutableBatchCommand.Builder toBeSaved(Iterable<? extends StencilClient.Entity> elements)
Sets or replaces all elements fortoBeSavedlist.- Parameters:
elements- An iterable of toBeSaved elements- Returns:
thisbuilder for use in a chained invocation
-
addAllToBeSaved
@CanIgnoreReturnValue public final ImmutableBatchCommand.Builder addAllToBeSaved(Iterable<? extends StencilClient.Entity> elements)
Adds elements totoBeSavedlist.- Parameters:
elements- An iterable of toBeSaved elements- Returns:
thisbuilder for use in a chained invocation
-
addToBeDeleted
@CanIgnoreReturnValue public final ImmutableBatchCommand.Builder addToBeDeleted(StencilClient.Entity element)
Adds one element totoBeDeletedlist.- Parameters:
element- A toBeDeleted element- Returns:
thisbuilder for use in a chained invocation
-
addToBeDeleted
@CanIgnoreReturnValue public final ImmutableBatchCommand.Builder addToBeDeleted(StencilClient.Entity... elements)
Adds elements totoBeDeletedlist.- Parameters:
elements- An array of toBeDeleted elements- Returns:
thisbuilder for use in a chained invocation
-
toBeDeleted
@CanIgnoreReturnValue public final ImmutableBatchCommand.Builder toBeDeleted(Iterable<? extends StencilClient.Entity> elements)
Sets or replaces all elements fortoBeDeletedlist.- Parameters:
elements- An iterable of toBeDeleted elements- Returns:
thisbuilder for use in a chained invocation
-
addAllToBeDeleted
@CanIgnoreReturnValue public final ImmutableBatchCommand.Builder addAllToBeDeleted(Iterable<? extends StencilClient.Entity> elements)
Adds elements totoBeDeletedlist.- Parameters:
elements- An iterable of toBeDeleted elements- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableBatchCommand build()
Builds a newImmutableBatchCommand.- Returns:
- An immutable instance of BatchCommand
- Throws:
IllegalStateException- if any required attributes are missing
-
-