From 236946b20ab80b9db65d15dc1e865b5ab5bc29a0 Mon Sep 17 00:00:00 2001 From: Guntis Smaukstelis Date: Tue, 16 May 2023 14:22:48 +0300 Subject: [PATCH] Add final to case classes --- src/main/scala/parse/Aggregate.scala | 10 +++++----- src/main/scala/parse/WeatherData.scala | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/scala/parse/Aggregate.scala b/src/main/scala/parse/Aggregate.scala index f83eb99..9b56a78 100644 --- a/src/main/scala/parse/Aggregate.scala +++ b/src/main/scala/parse/Aggregate.scala @@ -8,7 +8,7 @@ import parse.Parser.parseLine object Aggregate { - case class UserQuery( + final case class UserQuery( cities: List[String], field: String, key: AggregateKey @@ -45,10 +45,10 @@ object Aggregate { } sealed trait AggregateValue - case class DoubleValue(value: Double) extends AggregateValue - case class ListOptionValue(list: List[Option[Double]]) extends AggregateValue - case class StringListList(list: List[List[String]]) extends AggregateValue - case class DistinctStringList(list: List[String]) extends AggregateValue + final case class DoubleValue(value: Double) extends AggregateValue + final case class ListOptionValue(list: List[Option[Double]]) extends AggregateValue + final case class StringListList(list: List[List[String]]) extends AggregateValue + final case class DistinctStringList(list: List[String]) extends AggregateValue object AggregateValue { def getKeys: List[String] = { val runtimeMirror = scala.reflect.runtime.currentMirror diff --git a/src/main/scala/parse/WeatherData.scala b/src/main/scala/parse/WeatherData.scala index 59e707c..ce90917 100644 --- a/src/main/scala/parse/WeatherData.scala +++ b/src/main/scala/parse/WeatherData.scala @@ -4,13 +4,13 @@ import java.time.LocalDateTime import scala.reflect.runtime.universe._ -case class WeatherStationData( +final case class WeatherStationData( city: String, timestamp: LocalDateTime, weather: WeatherData, ) -case class WeatherData( +final case class WeatherData( tempMax: Option[Double], tempMin: Option[Double], tempAvg: Option[Double],