public static final class ImmutableSimple.Builder extends Object
ImmutableSimple.
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 |
|---|---|
ImmutableSimple |
build()
Builds a new
ImmutableSimple. |
ImmutableSimple.Builder |
from(InitListener.Simple instance)
Fill a builder with attribute values from the provided
Simple instance. |
ImmutableSimple.Builder |
onStateReached(BiConsumer<NamedType<?>,Object> onStateReached)
Initializes the optional value
onStateReached to onStateReached. |
ImmutableSimple.Builder |
onStateReached(Optional<BiConsumer<NamedType<?>,Object>> onStateReached)
Initializes the optional value
onStateReached to onStateReached. |
ImmutableSimple.Builder |
onTearDown(BiConsumer<NamedType<?>,Object> onTearDown)
Initializes the optional value
onTearDown to onTearDown. |
ImmutableSimple.Builder |
onTearDown(Optional<BiConsumer<NamedType<?>,Object>> onTearDown)
Initializes the optional value
onTearDown to onTearDown. |
public final ImmutableSimple.Builder from(InitListener.Simple instance)
Simple 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 ImmutableSimple.Builder onStateReached(BiConsumer<NamedType<?>,Object> onStateReached)
onStateReached to onStateReached.onStateReached - The value for onStateReachedthis builder for chained invocationpublic final ImmutableSimple.Builder onStateReached(Optional<BiConsumer<NamedType<?>,Object>> onStateReached)
onStateReached to onStateReached.onStateReached - The value for onStateReachedthis builder for use in a chained invocationpublic final ImmutableSimple.Builder onTearDown(BiConsumer<NamedType<?>,Object> onTearDown)
onTearDown to onTearDown.onTearDown - The value for onTearDownthis builder for chained invocationpublic final ImmutableSimple.Builder onTearDown(Optional<BiConsumer<NamedType<?>,Object>> onTearDown)
onTearDown to onTearDown.onTearDown - The value for onTearDownthis builder for use in a chained invocationpublic ImmutableSimple build()
ImmutableSimple.IllegalStateException - if any required attributes are missingCopyright © 2017. All rights reserved.