@NotThreadSafe 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 |
regExp(Optional<String> regExp)
Initializes the optional value
regExp to regExp. |
ImmutableTemplate.Builder |
regExp(String regExp)
Initializes the optional value
regExp to regExp. |
ImmutableTemplate.Builder |
type(String type)
Initializes the value for the
type attribute. |
@CanIgnoreReturnValue 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 invocation@CanIgnoreReturnValue public final ImmutableTemplate.Builder type(String type)
type attribute.type - The value for typethis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableTemplate.Builder regExp(String regExp)
regExp to regExp.regExp - The value for regExpthis builder for chained invocation@CanIgnoreReturnValue public final ImmutableTemplate.Builder regExp(Optional<String> regExp)
regExp to regExp.regExp - The value for regExpthis builder for use in a chained invocationpublic ImmutableTemplate build()
ImmutableTemplate.IllegalStateException - if any required attributes are missingCopyright © 2019. All rights reserved.