public static final class ImmutableNamedTypeAndState.Builder<T> extends Object
ImmutableNamedTypeAndState.
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 |
|---|---|
ImmutableNamedTypeAndState<T> |
build()
Builds a new
ImmutableNamedTypeAndState. |
ImmutableNamedTypeAndState.Builder<T> |
from(NamedTypeAndState<T> instance)
Fill a builder with attribute values from the provided
NamedTypeAndState instance. |
ImmutableNamedTypeAndState.Builder<T> |
state(State<T> state)
Initializes the value for the
state attribute. |
ImmutableNamedTypeAndState.Builder<T> |
type(NamedType<T> type)
Initializes the value for the
type attribute. |
public final ImmutableNamedTypeAndState.Builder<T> from(NamedTypeAndState<T> instance)
NamedTypeAndState 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 ImmutableNamedTypeAndState.Builder<T> type(NamedType<T> type)
type attribute.type - The value for typethis builder for use in a chained invocationpublic final ImmutableNamedTypeAndState.Builder<T> state(State<T> state)
state attribute.state - The value for statethis builder for use in a chained invocationpublic ImmutableNamedTypeAndState<T> build()
ImmutableNamedTypeAndState.IllegalStateException - if any required attributes are missingCopyright © 2017. All rights reserved.