public static final class ImmutableToken.Builder extends Object
ImmutableToken.
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 |
|---|---|
ImmutableToken |
build()
Builds a new
ImmutableToken. |
ImmutableToken.Builder |
from(Token instance)
Fill a builder with attribute values from the provided
Token instance. |
ImmutableToken.Builder |
start(int start)
Initializes the value for the
start attribute. |
ImmutableToken.Builder |
type(TokenType type)
Initializes the value for the
type attribute. |
ImmutableToken.Builder |
value(String value)
Initializes the value for the
value attribute. |
public final ImmutableToken.Builder from(Token instance)
Token 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 ImmutableToken.Builder start(int start)
start attribute.start - The value for startthis builder for use in a chained invocationpublic final ImmutableToken.Builder value(String value)
value attribute.value - The value for valuethis builder for use in a chained invocationpublic final ImmutableToken.Builder type(TokenType type)
type attribute.type - The value for typethis builder for use in a chained invocationpublic ImmutableToken build()
ImmutableToken.IllegalStateException - if any required attributes are missingCopyright © 2024. All rights reserved.