@NotThreadSafe public static final class ImmutableBlackoutPeriod.Builder extends Object
ImmutableBlackoutPeriod
.
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 |
---|---|
ImmutableBlackoutPeriod |
build()
Builds a new
ImmutableBlackoutPeriod . |
ImmutableBlackoutPeriod.Builder |
day(Day day)
Initializes the optional value
day to day. |
ImmutableBlackoutPeriod.Builder |
day(Optional<? extends Day> day)
Initializes the optional value
day to day. |
ImmutableBlackoutPeriod.Builder |
endTime(TimeOfDay endTime)
Initializes the value for the
endTime attribute. |
ImmutableBlackoutPeriod.Builder |
from(BlackoutPeriod instance)
Fill a builder with attribute values from the provided
BlackoutPeriod instance. |
ImmutableBlackoutPeriod.Builder |
startTime(TimeOfDay startTime)
Initializes the value for the
startTime attribute. |
public final ImmutableBlackoutPeriod.Builder from(BlackoutPeriod instance)
BlackoutPeriod
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 ImmutableBlackoutPeriod.Builder day(Day day)
day
to day.day
- The value for daythis
builder for chained invocationpublic final ImmutableBlackoutPeriod.Builder day(Optional<? extends Day> day)
day
to day.day
- The value for daythis
builder for use in a chained invocationpublic final ImmutableBlackoutPeriod.Builder endTime(TimeOfDay endTime)
endTime
attribute.endTime
- The value for endTimethis
builder for use in a chained invocationpublic final ImmutableBlackoutPeriod.Builder startTime(TimeOfDay startTime)
startTime
attribute.startTime
- The value for startTimethis
builder for use in a chained invocationpublic ImmutableBlackoutPeriod build()
ImmutableBlackoutPeriod
.IllegalStateException
- if any required attributes are missingCopyright © 2023 iland Internet Solutions, Corp. All rights reserved.