Package io.thestencil.persistence.api
Class ImmutableArticleMutator.Builder
- java.lang.Object
-
- io.thestencil.persistence.api.ImmutableArticleMutator.Builder
-
- Enclosing class:
- ImmutableArticleMutator
@NotThreadSafe public static final class ImmutableArticleMutator.Builder extends Object
Builds instances of typeImmutableArticleMutator. 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableArticleMutator.BuilderarticleId(String articleId)Initializes the value for thearticleIdattribute.ImmutableArticleMutatorbuild()Builds a newImmutableArticleMutator.ImmutableArticleMutator.Builderfrom(UpdateBuilder.ArticleMutator instance)Fill a builder with attribute values from the providedArticleMutatorinstance.ImmutableArticleMutator.Buildername(String name)Initializes the value for thenameattribute.ImmutableArticleMutator.Builderorder(Integer order)Initializes the value for theorderattribute.ImmutableArticleMutator.BuilderparentId(String parentId)Initializes the value for theparentIdattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableArticleMutator.Builder from(UpdateBuilder.ArticleMutator instance)
Fill a builder with attribute values from the providedArticleMutatorinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
articleId
@CanIgnoreReturnValue public final ImmutableArticleMutator.Builder articleId(String articleId)
Initializes the value for thearticleIdattribute.- Parameters:
articleId- The value for articleId- Returns:
thisbuilder for use in a chained invocation
-
parentId
@CanIgnoreReturnValue public final ImmutableArticleMutator.Builder parentId(@Nullable String parentId)
Initializes the value for theparentIdattribute.- Parameters:
parentId- The value for parentId (can benull)- Returns:
thisbuilder for use in a chained invocation
-
name
@CanIgnoreReturnValue public final ImmutableArticleMutator.Builder name(String name)
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
order
@CanIgnoreReturnValue public final ImmutableArticleMutator.Builder order(Integer order)
Initializes the value for theorderattribute.- Parameters:
order- The value for order- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableArticleMutator build()
Builds a newImmutableArticleMutator.- Returns:
- An immutable instance of ArticleMutator
- Throws:
IllegalStateException- if any required attributes are missing
-
-