Package io.thestencil.client.api
Class ImmutablePage.Builder
- java.lang.Object
-
- io.thestencil.client.api.ImmutablePage.Builder
-
- Enclosing class:
- ImmutablePage
@NotThreadSafe public static final class ImmutablePage.Builder extends Object
Builds instances of typeImmutablePage. 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 ImmutablePage.Builderarticle(String article)Initializes the value for thearticleattribute.ImmutablePagebuild()Builds a newImmutablePage.ImmutablePage.Buildercontent(String content)Initializes the value for thecontentattribute.ImmutablePage.BuilderdevMode(Boolean devMode)Initializes the value for thedevModeattribute.ImmutablePage.Builderfrom(StencilClient.Page instance)Fill a builder with attribute values from the providedPageinstance.ImmutablePage.Builderlocale(String locale)Initializes the value for thelocaleattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutablePage.Builder from(StencilClient.Page instance)
Fill a builder with attribute values from the providedPageinstance. 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
-
article
@CanIgnoreReturnValue public final ImmutablePage.Builder article(String article)
Initializes the value for thearticleattribute.- Parameters:
article- The value for article- Returns:
thisbuilder for use in a chained invocation
-
devMode
@CanIgnoreReturnValue public final ImmutablePage.Builder devMode(@Nullable Boolean devMode)
Initializes the value for thedevModeattribute.- Parameters:
devMode- The value for devMode (can benull)- Returns:
thisbuilder for use in a chained invocation
-
locale
@CanIgnoreReturnValue public final ImmutablePage.Builder locale(String locale)
Initializes the value for thelocaleattribute.- Parameters:
locale- The value for locale- Returns:
thisbuilder for use in a chained invocation
-
content
@CanIgnoreReturnValue public final ImmutablePage.Builder content(String content)
Initializes the value for thecontentattribute.- Parameters:
content- The value for content- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutablePage build()
Builds a newImmutablePage.- Returns:
- An immutable instance of Page
- Throws:
IllegalStateException- if any required attributes are missing
-
-