Package org.kigalisim.engine.state
Class SimulationStateUpdateBuilder
java.lang.Object
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 TypeMethodDescriptionbuild()Builds 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.
-
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
-
build
Builds the SimulationStateUpdate.- Returns:
- the built SimulationStateUpdate
- Throws:
IllegalStateException- if required fields are not set
-