public static final class ImmutableTemplate.Builder extends Object
ImmutableTemplate.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
| Modifier and Type | Method and Description |
|---|---|
ImmutableTemplate |
build()
Builds a new
ImmutableTemplate. |
ImmutableTemplate.Builder |
from(Template instance)
Fill a builder with attribute values from the provided
Template instance. |
ImmutableTemplate.Builder |
pattern(ReplacementPattern pattern)
Initializes the value for the
pattern attribute. |
ImmutableTemplate.Builder |
source(String source)
Initializes the value for the
source attribute. |
public final ImmutableTemplate.Builder from(Template instance)
Template instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.instance - The instance from which to copy valuesthis builder for use in a chained invocationpublic final ImmutableTemplate.Builder source(String source)
source attribute.source - The value for sourcethis builder for use in a chained invocationpublic final ImmutableTemplate.Builder pattern(ReplacementPattern pattern)
pattern attribute.
If not set, this attribute will have a default value as returned by the initializer of pattern.
pattern - The value for patternthis builder for use in a chained invocationpublic ImmutableTemplate build()
ImmutableTemplate.IllegalStateException - if any required attributes are missingCopyright © 2023. All rights reserved.