diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e56ad29ff..5902f1cb01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added option to directly zip the output files [#793](https://github.com/ie3-institute/simona/issues/793) - Added weatherData HowTo for Copernicus ERA5 data [#967](https://github.com/ie3-institute/simona/issues/967) - Add some quote to 'printGoodbye' [#997](https://github.com/ie3-institute/simona/issues/997) +- Add unapply method for ThermalHouseResults [#934](https://github.com/ie3-institute/simona/issues/934) - Integration test for thermal grids [#878](https://github.com/ie3-institute/simona/issues/878) ### Changed diff --git a/src/main/scala/edu/ie3/simona/event/ResultEvent.scala b/src/main/scala/edu/ie3/simona/event/ResultEvent.scala index a1a765d977..6e91283b65 100644 --- a/src/main/scala/edu/ie3/simona/event/ResultEvent.scala +++ b/src/main/scala/edu/ie3/simona/event/ResultEvent.scala @@ -61,20 +61,15 @@ object ResultEvent { ComparableQuantity[Power], ComparableQuantity[Temperature], ) - ] = { - if (result != null) { - Some( - ( - result.getTime, - result.getInputModel, - result.getqDot, - result.getIndoorTemperature, - ) + ] = + Option(result).map { result => + ( + result.getTime, + result.getInputModel, + result.getqDot, + result.getIndoorTemperature, ) - } else { - None } - } } object CylindricalThermalStorageResult { @@ -86,17 +81,13 @@ object ResultEvent { ComparableQuantity[Energy], ) ] = { - if (result != null) { - Some( - ( - result.getTime, - result.getInputModel, - result.getqDot, - result.getEnergy, - ) + Option(result).map { result => + ( + result.getTime, + result.getInputModel, + result.getqDot, + result.getEnergy, ) - } else { - None } } }