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.BuildercrossingPenaltyMultiplier(double crossingPenaltyMultiplier) Initializes the value for thecrossingPenaltyMultiplierattribute.final ZoneConnection.BuilderfromZoneId(String fromZoneId) Initializes the value for thefromZoneIdattribute.final ZoneConnection.BuilderInitializes the value for thetoZoneIdattribute.
-
Method Details
-
fromZoneId
Initializes the value for thefromZoneIdattribute.- Specified by:
fromZoneIdin interfaceZoneConnection.FromZoneIdBuildStage- Parameters:
fromZoneId- The value for fromZoneId- Returns:
thisbuilder for use in a chained invocation
-
toZoneId
Initializes the value for thetoZoneIdattribute.- Specified by:
toZoneIdin interfaceZoneConnection.ToZoneIdBuildStage- Parameters:
toZoneId- The value for toZoneId- Returns:
thisbuilder for use in a chained invocation
-
crossingPenaltyMultiplier
@CanIgnoreReturnValue public final ZoneConnection.Builder crossingPenaltyMultiplier(double crossingPenaltyMultiplier) Initializes the value for thecrossingPenaltyMultiplierattribute.If not set, this attribute will have a default value as returned by the initializer of
crossingPenaltyMultiplier.- Specified by:
crossingPenaltyMultiplierin interfaceZoneConnection.BuildFinal- Parameters:
crossingPenaltyMultiplier- The value for crossingPenaltyMultiplier- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newZoneConnection.- Specified by:
buildin interfaceZoneConnection.BuildFinal- Returns:
- An immutable instance of ZoneConnection
- Throws:
IllegalStateException- if any required attributes are missing
-