Package io.thestencil.client.api
Class ImmutableArticle.Builder
- java.lang.Object
-
- io.thestencil.client.api.ImmutableArticle.Builder
-
- Enclosing class:
- ImmutableArticle
@NotThreadSafe public static final class ImmutableArticle.Builder extends Object
Builds instances of typeImmutableArticle. 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 ImmutableArticlebuild()Builds a newImmutableArticle.ImmutableArticle.Builderfrom(StencilClient.Article instance)Fill a builder with attribute values from the providedArticleinstance.ImmutableArticle.Buildername(String name)Initializes the value for thenameattribute.ImmutableArticle.Builderorder(Integer order)Initializes the value for theorderattribute.ImmutableArticle.BuilderparentId(String parentId)Initializes the value for theparentIdattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableArticle.Builder from(StencilClient.Article instance)
Fill a builder with attribute values from the providedArticleinstance. 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
-
parentId
@CanIgnoreReturnValue public final ImmutableArticle.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 ImmutableArticle.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 ImmutableArticle.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 ImmutableArticle build()
Builds a newImmutableArticle.- Returns:
- An immutable instance of Article
- Throws:
IllegalStateException- if any required attributes are missing
-
-