Package io.thestencil.persistence.api
Class ImmutableSiteState.Builder
- java.lang.Object
-
- io.thestencil.persistence.api.ImmutableSiteState.Builder
-
- Enclosing class:
- ImmutableSiteState
@NotThreadSafe public static final class ImmutableSiteState.Builder extends Object
Builds instances of typeImmutableSiteState. 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 ImmutableSiteState.Builder from(ZoePersistence.SiteState instance)
Fill a builder with attribute values from the providedSiteStateinstance. 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
-
name
@CanIgnoreReturnValue public final ImmutableSiteState.Builder name(String name)
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
contentType
@CanIgnoreReturnValue public final ImmutableSiteState.Builder contentType(ZoePersistence.SiteContentType contentType)
Initializes the value for thecontentTypeattribute.- Parameters:
contentType- The value for contentType- Returns:
thisbuilder for use in a chained invocation
-
putReleases
@CanIgnoreReturnValue public final ImmutableSiteState.Builder putReleases(String key, ZoePersistence.Entity<ZoePersistence.Release> value)
Put one entry to thereleasesmap.- Parameters:
key- The key in the releases mapvalue- The associated value in the releases map- Returns:
thisbuilder for use in a chained invocation
-
putReleases
@CanIgnoreReturnValue public final ImmutableSiteState.Builder putReleases(Map.Entry<String,? extends ZoePersistence.Entity<ZoePersistence.Release>> entry)
Put one entry to thereleasesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
releases
@CanIgnoreReturnValue public final ImmutableSiteState.Builder releases(Map<String,? extends ZoePersistence.Entity<ZoePersistence.Release>> entries)
Sets or replaces all mappings from the specified map as entries for thereleasesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the releases map- Returns:
thisbuilder for use in a chained invocation
-
putAllReleases
@CanIgnoreReturnValue public final ImmutableSiteState.Builder putAllReleases(Map<String,? extends ZoePersistence.Entity<ZoePersistence.Release>> entries)
Put all mappings from the specified map as entries toreleasesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the releases map- Returns:
thisbuilder for use in a chained invocation
-
putLocales
@CanIgnoreReturnValue public final ImmutableSiteState.Builder putLocales(String key, ZoePersistence.Entity<ZoePersistence.Locale> value)
Put one entry to thelocalesmap.- Parameters:
key- The key in the locales mapvalue- The associated value in the locales map- Returns:
thisbuilder for use in a chained invocation
-
putLocales
@CanIgnoreReturnValue public final ImmutableSiteState.Builder putLocales(Map.Entry<String,? extends ZoePersistence.Entity<ZoePersistence.Locale>> entry)
Put one entry to thelocalesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
locales
@CanIgnoreReturnValue public final ImmutableSiteState.Builder locales(Map<String,? extends ZoePersistence.Entity<ZoePersistence.Locale>> entries)
Sets or replaces all mappings from the specified map as entries for thelocalesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the locales map- Returns:
thisbuilder for use in a chained invocation
-
putAllLocales
@CanIgnoreReturnValue public final ImmutableSiteState.Builder putAllLocales(Map<String,? extends ZoePersistence.Entity<ZoePersistence.Locale>> entries)
Put all mappings from the specified map as entries tolocalesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the locales map- Returns:
thisbuilder for use in a chained invocation
-
putPages
@CanIgnoreReturnValue public final ImmutableSiteState.Builder putPages(String key, ZoePersistence.Entity<ZoePersistence.Page> value)
Put one entry to thepagesmap.- Parameters:
key- The key in the pages mapvalue- The associated value in the pages map- Returns:
thisbuilder for use in a chained invocation
-
putPages
@CanIgnoreReturnValue public final ImmutableSiteState.Builder putPages(Map.Entry<String,? extends ZoePersistence.Entity<ZoePersistence.Page>> entry)
Put one entry to thepagesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
pages
@CanIgnoreReturnValue public final ImmutableSiteState.Builder pages(Map<String,? extends ZoePersistence.Entity<ZoePersistence.Page>> entries)
Sets or replaces all mappings from the specified map as entries for thepagesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the pages map- Returns:
thisbuilder for use in a chained invocation
-
putAllPages
@CanIgnoreReturnValue public final ImmutableSiteState.Builder putAllPages(Map<String,? extends ZoePersistence.Entity<ZoePersistence.Page>> entries)
Put all mappings from the specified map as entries topagesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the pages map- Returns:
thisbuilder for use in a chained invocation
-
putLinks
@CanIgnoreReturnValue public final ImmutableSiteState.Builder putLinks(String key, ZoePersistence.Entity<ZoePersistence.Link> value)
Put one entry to thelinksmap.- Parameters:
key- The key in the links mapvalue- The associated value in the links map- Returns:
thisbuilder for use in a chained invocation
-
putLinks
@CanIgnoreReturnValue public final ImmutableSiteState.Builder putLinks(Map.Entry<String,? extends ZoePersistence.Entity<ZoePersistence.Link>> entry)
Put one entry to thelinksmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
links
@CanIgnoreReturnValue public final ImmutableSiteState.Builder links(Map<String,? extends ZoePersistence.Entity<ZoePersistence.Link>> entries)
Sets or replaces all mappings from the specified map as entries for thelinksmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the links map- Returns:
thisbuilder for use in a chained invocation
-
putAllLinks
@CanIgnoreReturnValue public final ImmutableSiteState.Builder putAllLinks(Map<String,? extends ZoePersistence.Entity<ZoePersistence.Link>> entries)
Put all mappings from the specified map as entries tolinksmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the links map- Returns:
thisbuilder for use in a chained invocation
-
putArticles
@CanIgnoreReturnValue public final ImmutableSiteState.Builder putArticles(String key, ZoePersistence.Entity<ZoePersistence.Article> value)
Put one entry to thearticlesmap.- Parameters:
key- The key in the articles mapvalue- The associated value in the articles map- Returns:
thisbuilder for use in a chained invocation
-
putArticles
@CanIgnoreReturnValue public final ImmutableSiteState.Builder putArticles(Map.Entry<String,? extends ZoePersistence.Entity<ZoePersistence.Article>> entry)
Put one entry to thearticlesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
articles
@CanIgnoreReturnValue public final ImmutableSiteState.Builder articles(Map<String,? extends ZoePersistence.Entity<ZoePersistence.Article>> entries)
Sets or replaces all mappings from the specified map as entries for thearticlesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the articles map- Returns:
thisbuilder for use in a chained invocation
-
putAllArticles
@CanIgnoreReturnValue public final ImmutableSiteState.Builder putAllArticles(Map<String,? extends ZoePersistence.Entity<ZoePersistence.Article>> entries)
Put all mappings from the specified map as entries toarticlesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the articles map- Returns:
thisbuilder for use in a chained invocation
-
putWorkflows
@CanIgnoreReturnValue public final ImmutableSiteState.Builder putWorkflows(String key, ZoePersistence.Entity<ZoePersistence.Workflow> value)
Put one entry to theworkflowsmap.- Parameters:
key- The key in the workflows mapvalue- The associated value in the workflows map- Returns:
thisbuilder for use in a chained invocation
-
putWorkflows
@CanIgnoreReturnValue public final ImmutableSiteState.Builder putWorkflows(Map.Entry<String,? extends ZoePersistence.Entity<ZoePersistence.Workflow>> entry)
Put one entry to theworkflowsmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
workflows
@CanIgnoreReturnValue public final ImmutableSiteState.Builder workflows(Map<String,? extends ZoePersistence.Entity<ZoePersistence.Workflow>> entries)
Sets or replaces all mappings from the specified map as entries for theworkflowsmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the workflows map- Returns:
thisbuilder for use in a chained invocation
-
putAllWorkflows
@CanIgnoreReturnValue public final ImmutableSiteState.Builder putAllWorkflows(Map<String,? extends ZoePersistence.Entity<ZoePersistence.Workflow>> entries)
Put all mappings from the specified map as entries toworkflowsmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the workflows map- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableSiteState build()
Builds a newImmutableSiteState.- Returns:
- An immutable instance of SiteState
- Throws:
IllegalStateException- if any required attributes are missing
-
-