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