Package io.thestencil.staticontent.api
Class ImmutableTopicData.Builder
- java.lang.Object
-
- io.thestencil.staticontent.api.ImmutableTopicData.Builder
-
- Enclosing class:
- ImmutableTopicData
@NotThreadSafe public static final class ImmutableTopicData.Builder extends Object
Builds instances of typeImmutableTopicData. 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 ImmutableTopicData.Builder from(StaticContentClient.TopicData instance)
Fill a builder with attribute values from the providedTopicDatainstance. 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
-
path
@CanIgnoreReturnValue public final ImmutableTopicData.Builder path(String path)
Initializes the value for thepathattribute.- Parameters:
path- The value for path- Returns:
thisbuilder for use in a chained invocation
-
locale
@CanIgnoreReturnValue public final ImmutableTopicData.Builder locale(String locale)
Initializes the value for thelocaleattribute.- Parameters:
locale- The value for locale- Returns:
thisbuilder for use in a chained invocation
-
value
@CanIgnoreReturnValue public final ImmutableTopicData.Builder value(String value)
Initializes the value for thevalueattribute.- Parameters:
value- The value for value- Returns:
thisbuilder for use in a chained invocation
-
addHeadings
@CanIgnoreReturnValue public final ImmutableTopicData.Builder addHeadings(MarkdownContent.Heading element)
Adds one element toheadingslist.- Parameters:
element- A headings element- Returns:
thisbuilder for use in a chained invocation
-
addHeadings
@CanIgnoreReturnValue public final ImmutableTopicData.Builder addHeadings(MarkdownContent.Heading... elements)
Adds elements toheadingslist.- Parameters:
elements- An array of headings elements- Returns:
thisbuilder for use in a chained invocation
-
headings
@CanIgnoreReturnValue public final ImmutableTopicData.Builder headings(Iterable<? extends MarkdownContent.Heading> elements)
Sets or replaces all elements forheadingslist.- Parameters:
elements- An iterable of headings elements- Returns:
thisbuilder for use in a chained invocation
-
addAllHeadings
@CanIgnoreReturnValue public final ImmutableTopicData.Builder addAllHeadings(Iterable<? extends MarkdownContent.Heading> elements)
Adds elements toheadingslist.- Parameters:
elements- An iterable of headings elements- Returns:
thisbuilder for use in a chained invocation
-
addImages
@CanIgnoreReturnValue public final ImmutableTopicData.Builder addImages(MarkdownContent.ImageTag element)
Adds one element toimageslist.- Parameters:
element- A images element- Returns:
thisbuilder for use in a chained invocation
-
addImages
@CanIgnoreReturnValue public final ImmutableTopicData.Builder addImages(MarkdownContent.ImageTag... elements)
Adds elements toimageslist.- Parameters:
elements- An array of images elements- Returns:
thisbuilder for use in a chained invocation
-
images
@CanIgnoreReturnValue public final ImmutableTopicData.Builder images(Iterable<? extends MarkdownContent.ImageTag> elements)
Sets or replaces all elements forimageslist.- Parameters:
elements- An iterable of images elements- Returns:
thisbuilder for use in a chained invocation
-
addAllImages
@CanIgnoreReturnValue public final ImmutableTopicData.Builder addAllImages(Iterable<? extends MarkdownContent.ImageTag> elements)
Adds elements toimageslist.- Parameters:
elements- An iterable of images elements- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableTopicData build()
Builds a newImmutableTopicData.- Returns:
- An immutable instance of TopicData
- Throws:
IllegalStateException- if any required attributes are missing
-
-