Class ZoneConnection.Builder
java.lang.Object
com.dna.jopt.member.unit.zonemanager.ZoneConnection.Builder
- All Implemented Interfaces:
ZoneConnection.BuildFinal
,ZoneConnection.FromZoneIdBuildStage
,ZoneConnection.ToZoneIdBuildStage
- Enclosing class:
- ZoneConnection
@NotThreadSafe
public static final class ZoneConnection.Builder
extends Object
implements ZoneConnection.FromZoneIdBuildStage, ZoneConnection.ToZoneIdBuildStage, ZoneConnection.BuildFinal
Builds instances of type
ZoneConnection
.
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.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newZoneConnection
.final ZoneConnection.Builder
crossingPenaltyMultiplier
(double crossingPenaltyMultiplier) Initializes the value for thecrossingPenaltyMultiplier
attribute.final ZoneConnection.Builder
fromZoneId
(String fromZoneId) Initializes the value for thefromZoneId
attribute.final ZoneConnection.Builder
Initializes the value for thetoZoneId
attribute.
-
Method Details
-
fromZoneId
Initializes the value for thefromZoneId
attribute.- Specified by:
fromZoneId
in interfaceZoneConnection.FromZoneIdBuildStage
- Parameters:
fromZoneId
- The value for fromZoneId- Returns:
this
builder for use in a chained invocation
-
toZoneId
Initializes the value for thetoZoneId
attribute.- Specified by:
toZoneId
in interfaceZoneConnection.ToZoneIdBuildStage
- Parameters:
toZoneId
- The value for toZoneId- Returns:
this
builder for use in a chained invocation
-
crossingPenaltyMultiplier
@CanIgnoreReturnValue public final ZoneConnection.Builder crossingPenaltyMultiplier(double crossingPenaltyMultiplier) Initializes the value for thecrossingPenaltyMultiplier
attribute.If not set, this attribute will have a default value as returned by the initializer of
crossingPenaltyMultiplier
.- Specified by:
crossingPenaltyMultiplier
in interfaceZoneConnection.BuildFinal
- Parameters:
crossingPenaltyMultiplier
- The value for crossingPenaltyMultiplier- Returns:
this
builder for use in a chained invocation
-
build
Builds a newZoneConnection
.- Specified by:
build
in interfaceZoneConnection.BuildFinal
- Returns:
- An immutable instance of ZoneConnection
- Throws:
IllegalStateException
- if any required attributes are missing
-