Package io.thestencil.client.api
Class ImmutableRelease.Builder
- java.lang.Object
-
- io.thestencil.client.api.ImmutableRelease.Builder
-
- Enclosing class:
- ImmutableRelease
@NotThreadSafe public static final class ImmutableRelease.Builder extends Object
Builds instances of typeImmutableRelease. 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 ImmutableRelease.Builder from(StencilClient.Release instance)
Fill a builder with attribute values from the providedReleaseinstance. 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
-
parentCommit
@CanIgnoreReturnValue public final ImmutableRelease.Builder parentCommit(String parentCommit)
Initializes the value for theparentCommitattribute.- Parameters:
parentCommit- The value for parentCommit- Returns:
thisbuilder for use in a chained invocation
-
name
@CanIgnoreReturnValue public final ImmutableRelease.Builder name(String name)
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
note
@CanIgnoreReturnValue public final ImmutableRelease.Builder note(String note)
Initializes the value for thenoteattribute.- Parameters:
note- The value for note- Returns:
thisbuilder for use in a chained invocation
-
created
@CanIgnoreReturnValue public final ImmutableRelease.Builder created(LocalDateTime created)
Initializes the value for thecreatedattribute.- Parameters:
created- The value for created- Returns:
thisbuilder for use in a chained invocation
-
addLocales
@CanIgnoreReturnValue public final ImmutableRelease.Builder addLocales(StencilClient.LocaleReleaseItem element)
Adds one element tolocaleslist.- Parameters:
element- A locales element- Returns:
thisbuilder for use in a chained invocation
-
addLocales
@CanIgnoreReturnValue public final ImmutableRelease.Builder addLocales(StencilClient.LocaleReleaseItem... elements)
Adds elements tolocaleslist.- Parameters:
elements- An array of locales elements- Returns:
thisbuilder for use in a chained invocation
-
locales
@CanIgnoreReturnValue public final ImmutableRelease.Builder locales(Iterable<? extends StencilClient.LocaleReleaseItem> elements)
Sets or replaces all elements forlocaleslist.- Parameters:
elements- An iterable of locales elements- Returns:
thisbuilder for use in a chained invocation
-
addAllLocales
@CanIgnoreReturnValue public final ImmutableRelease.Builder addAllLocales(Iterable<? extends StencilClient.LocaleReleaseItem> elements)
Adds elements tolocaleslist.- Parameters:
elements- An iterable of locales elements- Returns:
thisbuilder for use in a chained invocation
-
addArticles
@CanIgnoreReturnValue public final ImmutableRelease.Builder addArticles(StencilClient.ArticleReleaseItem element)
Adds one element toarticleslist.- Parameters:
element- A articles element- Returns:
thisbuilder for use in a chained invocation
-
addArticles
@CanIgnoreReturnValue public final ImmutableRelease.Builder addArticles(StencilClient.ArticleReleaseItem... elements)
Adds elements toarticleslist.- Parameters:
elements- An array of articles elements- Returns:
thisbuilder for use in a chained invocation
-
articles
@CanIgnoreReturnValue public final ImmutableRelease.Builder articles(Iterable<? extends StencilClient.ArticleReleaseItem> elements)
Sets or replaces all elements forarticleslist.- Parameters:
elements- An iterable of articles elements- Returns:
thisbuilder for use in a chained invocation
-
addAllArticles
@CanIgnoreReturnValue public final ImmutableRelease.Builder addAllArticles(Iterable<? extends StencilClient.ArticleReleaseItem> elements)
Adds elements toarticleslist.- Parameters:
elements- An iterable of articles elements- Returns:
thisbuilder for use in a chained invocation
-
addLinks
@CanIgnoreReturnValue public final ImmutableRelease.Builder addLinks(StencilClient.LinkReleaseItem element)
Adds one element tolinkslist.- Parameters:
element- A links element- Returns:
thisbuilder for use in a chained invocation
-
addLinks
@CanIgnoreReturnValue public final ImmutableRelease.Builder addLinks(StencilClient.LinkReleaseItem... elements)
Adds elements tolinkslist.- Parameters:
elements- An array of links elements- Returns:
thisbuilder for use in a chained invocation
-
links
@CanIgnoreReturnValue public final ImmutableRelease.Builder links(Iterable<? extends StencilClient.LinkReleaseItem> elements)
Sets or replaces all elements forlinkslist.- Parameters:
elements- An iterable of links elements- Returns:
thisbuilder for use in a chained invocation
-
addAllLinks
@CanIgnoreReturnValue public final ImmutableRelease.Builder addAllLinks(Iterable<? extends StencilClient.LinkReleaseItem> elements)
Adds elements tolinkslist.- Parameters:
elements- An iterable of links elements- Returns:
thisbuilder for use in a chained invocation
-
addWorkflows
@CanIgnoreReturnValue public final ImmutableRelease.Builder addWorkflows(StencilClient.WorkflowReleaseItem element)
Adds one element toworkflowslist.- Parameters:
element- A workflows element- Returns:
thisbuilder for use in a chained invocation
-
addWorkflows
@CanIgnoreReturnValue public final ImmutableRelease.Builder addWorkflows(StencilClient.WorkflowReleaseItem... elements)
Adds elements toworkflowslist.- Parameters:
elements- An array of workflows elements- Returns:
thisbuilder for use in a chained invocation
-
workflows
@CanIgnoreReturnValue public final ImmutableRelease.Builder workflows(Iterable<? extends StencilClient.WorkflowReleaseItem> elements)
Sets or replaces all elements forworkflowslist.- Parameters:
elements- An iterable of workflows elements- Returns:
thisbuilder for use in a chained invocation
-
addAllWorkflows
@CanIgnoreReturnValue public final ImmutableRelease.Builder addAllWorkflows(Iterable<? extends StencilClient.WorkflowReleaseItem> elements)
Adds elements toworkflowslist.- Parameters:
elements- An iterable of workflows elements- Returns:
thisbuilder for use in a chained invocation
-
addPages
@CanIgnoreReturnValue public final ImmutableRelease.Builder addPages(StencilClient.PageReleaseItem element)
Adds one element topageslist.- Parameters:
element- A pages element- Returns:
thisbuilder for use in a chained invocation
-
addPages
@CanIgnoreReturnValue public final ImmutableRelease.Builder addPages(StencilClient.PageReleaseItem... elements)
Adds elements topageslist.- Parameters:
elements- An array of pages elements- Returns:
thisbuilder for use in a chained invocation
-
pages
@CanIgnoreReturnValue public final ImmutableRelease.Builder pages(Iterable<? extends StencilClient.PageReleaseItem> elements)
Sets or replaces all elements forpageslist.- Parameters:
elements- An iterable of pages elements- Returns:
thisbuilder for use in a chained invocation
-
addAllPages
@CanIgnoreReturnValue public final ImmutableRelease.Builder addAllPages(Iterable<? extends StencilClient.PageReleaseItem> elements)
Adds elements topageslist.- Parameters:
elements- An iterable of pages elements- Returns:
thisbuilder for use in a chained invocation
-
addTemplates
@CanIgnoreReturnValue public final ImmutableRelease.Builder addTemplates(StencilClient.TemplateReleaseItem element)
Adds one element totemplateslist.- Parameters:
element- A templates element- Returns:
thisbuilder for use in a chained invocation
-
addTemplates
@CanIgnoreReturnValue public final ImmutableRelease.Builder addTemplates(StencilClient.TemplateReleaseItem... elements)
Adds elements totemplateslist.- Parameters:
elements- An array of templates elements- Returns:
thisbuilder for use in a chained invocation
-
templates
@CanIgnoreReturnValue public final ImmutableRelease.Builder templates(Iterable<? extends StencilClient.TemplateReleaseItem> elements)
Sets or replaces all elements fortemplateslist.- Parameters:
elements- An iterable of templates elements- Returns:
thisbuilder for use in a chained invocation
-
addAllTemplates
@CanIgnoreReturnValue public final ImmutableRelease.Builder addAllTemplates(Iterable<? extends StencilClient.TemplateReleaseItem> elements)
Adds elements totemplateslist.- Parameters:
elements- An iterable of templates elements- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableRelease build()
Builds a newImmutableRelease.- Returns:
- An immutable instance of Release
- Throws:
IllegalStateException- if any required attributes are missing
-
-