Class ImplicitRechargeUpdateBuilder
Configure the builder with the stream context (use key, stream name, value, flags) and the
supporting state access (simulation state, unit converter, base state getter, and the
precomputed recharge volume), then call buildUpdate() for unit-based sales updates or
buildClear() to clear the implicit streams for volume-based sales.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuilds a clear operation for a volume-based sales stream.Builds the implicit servicing update for a unit-based sales stream.setIsSales(boolean isSales) Sets whether this is a sales stream.setIsSalesSubstream(boolean isSalesSubstream) Sets whether this is a sales substream (domestic or import).setRechargeVolume(EngineNumber rechargeVolume) Sets the precomputed recharge volume to apply.setSimulationState(SimulationState simulationState) Sets the simulation state used to query recharge and precharge configuration.setStateGetter(StateGetter stateGetter) Sets the base state getter used when constructing the precharge converter.setStreamName(String streamName) Sets the name of the stream being set.setUnitConverter(UnitConverter unitConverter) Sets the unit converter used to convert the user-specified value.Sets the use key containing application and substance.setValue(EngineNumber value) Sets the original value specified by the user.
-
Constructor Details
-
ImplicitRechargeUpdateBuilder
public ImplicitRechargeUpdateBuilder()
-
-
Method Details
-
setUseKey
Sets the use key containing application and substance.- Parameters:
useKey- The use key for the operation- Returns:
- This builder for fluent chaining
-
setStreamName
Sets the name of the stream being set.- Parameters:
streamName- The stream name being updated- Returns:
- This builder for fluent chaining
-
setValue
Sets the original value specified by the user.- Parameters:
value- The value being set for the stream- Returns:
- This builder for fluent chaining
-
setIsSalesSubstream
Sets whether this is a sales substream (domestic or import).- Parameters:
isSalesSubstream- True if the stream is a sales substream- Returns:
- This builder for fluent chaining
-
setIsSales
Sets whether this is a sales stream.- Parameters:
isSales- True if the stream is a sales stream- Returns:
- This builder for fluent chaining
-
setSimulationState
Sets the simulation state used to query recharge and precharge configuration.- Parameters:
simulationState- The simulation state (stream keeper) to query- Returns:
- This builder for fluent chaining
-
setUnitConverter
Sets the unit converter used to convert the user-specified value.- Parameters:
unitConverter- The unit converter for value conversion- Returns:
- This builder for fluent chaining
-
setStateGetter
Sets the base state getter used when constructing the precharge converter.- Parameters:
stateGetter- The base state getter for precharge conversions- Returns:
- This builder for fluent chaining
-
setRechargeVolume
Sets the precomputed recharge volume to apply.- Parameters:
rechargeVolume- The recharge volume in kg, as computed byRechargeVolumeCalculator- Returns:
- This builder for fluent chaining
-
buildUpdate
Builds the implicit servicing update for a unit-based sales stream.This combines the recharge portion (always applied) and, when the user has configured a non-zero precharge population, the precharge portion into a single
ImplicitRechargeUpdatethat adjusts the stream value and records the implicit servicing volumes.- Returns:
- An ImplicitRechargeUpdate with the adjusted value and state updates
-
buildClear
Builds a clear operation for a volume-based sales stream.For sales streams set without equipment units, the implicit recharge and precharge streams are zeroed out. For non-sales streams, no implicit servicing is needed and an empty update is returned.
- Returns:
- An ImplicitRechargeUpdate clearing the implicit streams if needed
-