Class OptimizationAlgorithmPluginResult.Builder
java.lang.Object
com.dna.jopt.cloud.touroptimizer.pluginservice.algorithm.OptimizationAlgorithmPluginResult.Builder
- All Implemented Interfaces:
OptimizationAlgorithmPluginResult.BuildFinal
,OptimizationAlgorithmPluginResult.StatusBuildStage
- Enclosing class:
- OptimizationAlgorithmPluginResult
@NotThreadSafe
public static final class OptimizationAlgorithmPluginResult.Builder
extends Object
implements OptimizationAlgorithmPluginResult.StatusBuildStage, OptimizationAlgorithmPluginResult.BuildFinal
Builds instances of type
OptimizationAlgorithmPluginResult
.
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 TypeMethodDescriptionAdds elements toens
list.Adds one element toens
list.Adds elements toens
list.build()
Builds a newOptimizationAlgorithmPluginResult
.status
(AlgorithmPluginResultStatus status) Initializes the value for thestatus
attribute.
-
Method Details
-
addEns
@CanIgnoreReturnValue public final OptimizationAlgorithmPluginResult.Builder addEns(IEntity element) Adds one element toens
list.- Specified by:
addEns
in interfaceOptimizationAlgorithmPluginResult.BuildFinal
- Parameters:
element
- A ens element- Returns:
this
builder for use in a chained invocation
-
addEns
@CanIgnoreReturnValue public final OptimizationAlgorithmPluginResult.Builder addEns(IEntity... elements) Adds elements toens
list.- Specified by:
addEns
in interfaceOptimizationAlgorithmPluginResult.BuildFinal
- Parameters:
elements
- An array of ens elements- Returns:
this
builder for use in a chained invocation
-
addAllEns
@CanIgnoreReturnValue public final OptimizationAlgorithmPluginResult.Builder addAllEns(Iterable<? extends IEntity> elements) Adds elements toens
list.- Specified by:
addAllEns
in interfaceOptimizationAlgorithmPluginResult.BuildFinal
- Parameters:
elements
- An iterable of ens elements- Returns:
this
builder for use in a chained invocation
-
status
@CanIgnoreReturnValue public final OptimizationAlgorithmPluginResult.Builder status(AlgorithmPluginResultStatus status) Initializes the value for thestatus
attribute.- Specified by:
status
in interfaceOptimizationAlgorithmPluginResult.StatusBuildStage
- Parameters:
status
- The value for status- Returns:
this
builder for use in a chained invocation
-
build
Builds a newOptimizationAlgorithmPluginResult
.- Specified by:
build
in interfaceOptimizationAlgorithmPluginResult.BuildFinal
- Returns:
- An immutable instance of OptimizationAlgorithmPluginResult
- Throws:
IllegalStateException
- if any required attributes are missing
-