Class EngineResultBuilder

java.lang.Object
org.kigalisim.engine.serializer.EngineResultBuilder

public class EngineResultBuilder extends Object
Builder pattern implementation for creating EngineResult objects.

This builder ensures that all required fields are provided before constructing an EngineResult instance.

  • Constructor Details

    • EngineResultBuilder

      public EngineResultBuilder()
      Create builder without any values initialized.
  • Method Details

    • setApplication

      public EngineResultBuilder setApplication(String application)
      Set the application for which a result is being given.
      Parameters:
      application - The application name like "commercialRefrigeration"
      Returns:
      This builder for method chaining
    • setSubstance

      public EngineResultBuilder setSubstance(String substance)
      Set the substance for which a result is being given.
      Parameters:
      substance - The substance name like "HFC-134a"
      Returns:
      This builder for method chaining
    • setYear

      public EngineResultBuilder setYear(int year)
      Set the year for which a result is being given.
      Parameters:
      year - The year for which the result is relevant
      Returns:
      This builder for method chaining
    • setScenarioName

      public EngineResultBuilder setScenarioName(String scenarioName)
      Set the scenario name for which a result is being given.
      Parameters:
      scenarioName - The name of the scenario being run
      Returns:
      This builder for method chaining
    • setTrialNumber

      public EngineResultBuilder setTrialNumber(int trialNumber)
      Set the trial number for which a result is being given.
      Parameters:
      trialNumber - The trial number of the current run
      Returns:
      This builder for method chaining
    • setDomesticValue

      public EngineResultBuilder setDomesticValue(EngineNumber domesticValue)
      Set the domestic value.
      Parameters:
      domesticValue - The value associated with domestic production in volume like kg
      Returns:
      This builder for method chaining
    • setImportValue

      public EngineResultBuilder setImportValue(EngineNumber importValue)
      Set the import value.
      Parameters:
      importValue - The value related to imports like in volume like kg
      Returns:
      This builder for method chaining
    • setRecycleValue

      public EngineResultBuilder setRecycleValue(EngineNumber recycleValue)
      Set the recycle value.
      Parameters:
      recycleValue - The value denoting recycled materials in volume like kg
      Returns:
      This builder for method chaining
    • setDomesticConsumptionValue

      public EngineResultBuilder setDomesticConsumptionValue(EngineNumber domesticConsumptionValue)
      Set the domestic consumption value.
      Parameters:
      domesticConsumptionValue - The domestic consumption value in tCO2e or equivalent
      Returns:
      This builder for method chaining
    • setImportConsumptionValue

      public EngineResultBuilder setImportConsumptionValue(EngineNumber importConsumptionValue)
      Set the import consumption value.
      Parameters:
      importConsumptionValue - The import consumption value in tCO2e or equivalent
      Returns:
      This builder for method chaining
    • setRecycleConsumptionValue

      public EngineResultBuilder setRecycleConsumptionValue(EngineNumber recycleConsumptionValue)
      Set the recycle consumption value.
      Parameters:
      recycleConsumptionValue - The recycle consumption value in tCO2e or equivalent
      Returns:
      This builder for method chaining
    • setPopulationValue

      public EngineResultBuilder setPopulationValue(EngineNumber populationValue)
      Set the population value.
      Parameters:
      populationValue - The population value in terms of equipment
      Returns:
      This builder for method chaining
    • setPopulationNew

      public EngineResultBuilder setPopulationNew(EngineNumber populationNew)
      Set the population new value.
      Parameters:
      populationNew - The amount of new equipment added this year
      Returns:
      This builder for method chaining
    • setRechargeEmissions

      public EngineResultBuilder setRechargeEmissions(EngineNumber rechargeEmissions)
      Set the recharge emissions value.
      Parameters:
      rechargeEmissions - The greenhouse gas emissions from recharge activities
      Returns:
      This builder for method chaining
    • setEolEmissions

      public EngineResultBuilder setEolEmissions(EngineNumber eolEmissions)
      Set the end-of-life emissions value.
      Parameters:
      eolEmissions - The greenhouse gas emissions from end-of-life equipment
      Returns:
      This builder for method chaining
    • setInitialChargeEmissions

      public EngineResultBuilder setInitialChargeEmissions(EngineNumber initialChargeEmissions)
      Set the initial charge emissions value.

      This is an informational metric representing the GHG potential of substance initially charged into equipment. Actual emissions occur later during recharge (leakage between servicings) or at end-of-life disposal.

      Parameters:
      initialChargeEmissions - The greenhouse gas emissions from initial charge activities
      Returns:
      This builder for method chaining
    • setEnergyConsumption

      public EngineResultBuilder setEnergyConsumption(EngineNumber energyConsumption)
      Set the energy consumption value.
      Parameters:
      energyConsumption - The energy consumption value
      Returns:
      This builder for method chaining
    • setExportValue

      public EngineResultBuilder setExportValue(EngineNumber exportValue)
      Set the export value.
      Parameters:
      exportValue - The export value in volume like kg
      Returns:
      This builder for method chaining
    • setExportConsumptionValue

      public EngineResultBuilder setExportConsumptionValue(EngineNumber exportConsumptionValue)
      Set the export consumption value.
      Parameters:
      exportConsumptionValue - The export consumption value in tCO2e or equivalent
      Returns:
      This builder for method chaining
    • setTradeSupplement

      public EngineResultBuilder setTradeSupplement(TradeSupplement tradeSupplement)
      Set the trade supplement data.
      Parameters:
      tradeSupplement - Supplemental trade information
      Returns:
      This builder for method chaining
    • setBankKg

      public EngineResultBuilder setBankKg(EngineNumber bankKg)
      Set the bank kg value.
      Parameters:
      bankKg - The total substance volume in equipment bank in kg
      Returns:
      This builder for method chaining
    • setBankTco2e

      public EngineResultBuilder setBankTco2e(EngineNumber bankTco2e)
      Set the bank tCO2e value.
      Parameters:
      bankTco2e - The total GHG potential of substance in equipment bank in tCO2e
      Returns:
      This builder for method chaining
    • setBankChangeKg

      public EngineResultBuilder setBankChangeKg(EngineNumber bankChangeKg)
      Set the bank change kg value.
      Parameters:
      bankChangeKg - The change in substance bank from previous year in kg
      Returns:
      This builder for method chaining
    • setBankChangeTco2e

      public EngineResultBuilder setBankChangeTco2e(EngineNumber bankChangeTco2e)
      Set the bank change tCO2e value.
      Parameters:
      bankChangeTco2e - The change in GHG potential of substance bank from previous year in tCO2e
      Returns:
      This builder for method chaining
    • getApplication

      public String getApplication()
      Get the application value.
      Returns:
      The application value
    • getSubstance

      public String getSubstance()
      Get the substance value.
      Returns:
      The substance value
    • getYear

      public int getYear()
      Get the year value.
      Returns:
      The year value
    • getScenarioName

      public String getScenarioName()
      Get the scenario name value.
      Returns:
      The scenario name value
    • getTrialNumber

      public int getTrialNumber()
      Get the trial number value.
      Returns:
      The trial number value
    • getDomesticValue

      public EngineNumber getDomesticValue()
      Get the domestic value.
      Returns:
      The domestic value
    • getImportValue

      public EngineNumber getImportValue()
      Get the import value.
      Returns:
      The import value
    • getRecycleValue

      public EngineNumber getRecycleValue()
      Get the recycle value.
      Returns:
      The recycle value
    • getDomesticConsumptionValue

      public EngineNumber getDomesticConsumptionValue()
      Get the domestic consumption value.
      Returns:
      The domestic consumption value
    • getImportConsumptionValue

      public EngineNumber getImportConsumptionValue()
      Get the import consumption value.
      Returns:
      The import consumption value
    • getRecycleConsumptionValue

      public EngineNumber getRecycleConsumptionValue()
      Get the recycle consumption value.
      Returns:
      The recycle consumption value
    • getPopulationValue

      public EngineNumber getPopulationValue()
      Get the population value.
      Returns:
      The population value
    • getPopulationNew

      public EngineNumber getPopulationNew()
      Get the population new value.
      Returns:
      The population new value
    • getRechargeEmissions

      public EngineNumber getRechargeEmissions()
      Get the recharge emissions value.
      Returns:
      The recharge emissions value
    • getEolEmissions

      public EngineNumber getEolEmissions()
      Get the end-of-life emissions value.
      Returns:
      The end-of-life emissions value
    • getInitialChargeEmissions

      public EngineNumber getInitialChargeEmissions()
      Get the initial charge emissions value.
      Returns:
      The initial charge emissions value
    • getEnergyConsumption

      public EngineNumber getEnergyConsumption()
      Get the energy consumption value.
      Returns:
      The energy consumption value
    • getExportValue

      public EngineNumber getExportValue()
      Get the export value.
      Returns:
      The export value
    • getExportConsumptionValue

      public EngineNumber getExportConsumptionValue()
      Get the export consumption value.
      Returns:
      The export consumption value
    • getTradeSupplement

      public TradeSupplement getTradeSupplement()
      Get the trade supplement data.
      Returns:
      The trade supplement data
    • getBankKg

      public EngineNumber getBankKg()
      Get the bank kg value.
      Returns:
      The bank kg value
    • getBankTco2e

      public EngineNumber getBankTco2e()
      Get the bank tCO2e value.
      Returns:
      The bank tCO2e value
    • getBankChangeKg

      public EngineNumber getBankChangeKg()
      Get the bank change kg value.
      Returns:
      The bank change kg value
    • getBankChangeTco2e

      public EngineNumber getBankChangeTco2e()
      Get the bank change tCO2e value.
      Returns:
      The bank change tCO2e value
    • build

      public EngineResult build()
      Check that the builder is complete and create a new result.
      Returns:
      The result built from the values provided to this builder
      Throws:
      IllegalStateException - if any required field is missing