Package org.kigalisim.engine.state
Class SimulationStateUpdateBuilder
java.lang.Object
org.kigalisim.engine.support.ValidatedBuilder<SimulationStateUpdate>
org.kigalisim.engine.state.SimulationStateUpdateBuilder
Builder for creating SimulationStateUpdate instances.
Provides a fluent interface for constructing SimulationStateUpdate objects with validation and sensible defaults.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new SimulationStateUpdateBuilder with default values. -
Method Summary
Modifier and TypeMethodDescriptionprotected SimulationStateUpdateBuilds the SimulationStateUpdate.Clears the distribution.setDistribution(SalesStreamDistribution distribution) Sets the pre-calculated distribution for sales streams.setInvalidatePriorEquipment(boolean invalidatePriorEquipment) Sets whether this update should invalidate prior equipment cumulative bases.Sets the stream name.setSubtractRecycling(boolean subtractRecycling) Sets whether to subtract recycling from the value.Sets the use key containing application and substance.setValue(EngineNumber value) Sets the pre-computed stream value.protected voidvalidate()Check that all required fields are set before construction.Methods inherited from class org.kigalisim.engine.support.ValidatedBuilder
build, requireField, requireField
-
Constructor Details
-
SimulationStateUpdateBuilder
public SimulationStateUpdateBuilder()Creates a new SimulationStateUpdateBuilder with default values.
-
-
Method Details
-
setUseKey
Sets the use key containing application and substance.- Parameters:
useKey- the use key- Returns:
- this builder
-
setName
Sets the stream name.- Parameters:
name- the stream name- Returns:
- this builder
-
setValue
Sets the pre-computed stream value.- Parameters:
value- the stream value- Returns:
- this builder
-
setSubtractRecycling
Sets whether to subtract recycling from the value.- Parameters:
subtractRecycling- whether to subtract recycling- Returns:
- this builder
-
setDistribution
Sets the pre-calculated distribution for sales streams.- Parameters:
distribution- the sales stream distribution- Returns:
- this builder
-
clearDistribution
Clears the distribution.- Returns:
- this builder
-
setInvalidatePriorEquipment
Sets whether this update should invalidate prior equipment cumulative bases.- Parameters:
invalidatePriorEquipment- true if this update should trigger base invalidation- Returns:
- this builder
-
validate
protected void validate()Check that all required fields are set before construction.- Specified by:
validatein classValidatedBuilder<SimulationStateUpdate>- Throws:
IllegalStateException- if required fields are not set
-
buildInternal
Builds the SimulationStateUpdate.- Specified by:
buildInternalin classValidatedBuilder<SimulationStateUpdate>- Returns:
- the built SimulationStateUpdate
-