Skip to content

Commit 86183ac

Browse files
authored
♻️ Make remaining case classes final. (#358)
1 parent 76f7aa2 commit 86183ac

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

oauth2-jsoniter/shared/src/main/scala/com/ocadotechnology/sttp/oauth2/json/jsoniter/JsoniterJsonDecoders.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ trait JsoniterJsonDecoders {
134134

135135
object JsoniterJsonDecoders {
136136

137-
private case class TokenType(tokenType: String)
137+
private final case class TokenType(tokenType: String)
138138

139139
private implicit val tokenTypeDecoder: JsonValueCodec[TokenType] =
140140
JsonCodecMaker.make(CodecMakerConfig.withFieldNameMapper(JsonCodecMaker.enforce_snake_case))
141141

142-
private case class IntermediateOAuth2Error(error: String, errorDescription: Option[String])
142+
private final case class IntermediateOAuth2Error(error: String, errorDescription: Option[String])
143143

144144
private implicit val oAuth2ErrorHelperDecoder: JsonValueCodec[IntermediateOAuth2Error] =
145145
JsonCodecMaker.make(CodecMakerConfig.withFieldNameMapper(JsonCodecMaker.enforce_snake_case))

oauth2/shared/src/main/scala/com/ocadotechnology/sttp/oauth2/AuthorizationCodeProvider.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ object AuthorizationCodeProvider {
8888

8989
object Config {
9090

91-
case class Path(segments: List[Segment]) {
91+
final case class Path(segments: List[Segment]) {
9292
def values: List[String] = segments.map(_.value)
9393
}
9494

95-
case class Segment(value: String) extends AnyVal
95+
final case class Segment(value: String) extends AnyVal
9696

9797
// Values chosen for backwards compatibilty
9898
val default: Config = Config(

oauth2/shared/src/main/scala/com/ocadotechnology/sttp/oauth2/OAuth2TokenResponse.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package com.ocadotechnology.sttp.oauth2
22

33
import scala.concurrent.duration.FiniteDuration
44

5-
case class OAuth2TokenResponse(
5+
final case class OAuth2TokenResponse(
66
accessToken: Secret[String],
77
scope: String,
88
tokenType: String,
@@ -36,7 +36,7 @@ object OAuth2TokenResponse {
3636
}
3737

3838
// @deprecated("This model will be removed in next release", "0.10.0")
39-
case class ExtendedOAuth2TokenResponse(
39+
final case class ExtendedOAuth2TokenResponse(
4040
accessToken: Secret[String],
4141
refreshToken: String,
4242
expiresIn: FiniteDuration,

oauth2/shared/src/main/scala/com/ocadotechnology/sttp/oauth2/json/JsonDecoder.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait JsonDecoder[A] {
99
object JsonDecoder {
1010
def apply[A](implicit ev: JsonDecoder[A]): JsonDecoder[A] = ev
1111

12-
case class Error(message: String, cause: Option[Throwable] = None) extends Exception(message, cause.orNull)
12+
final case class Error(message: String, cause: Option[Throwable] = None) extends Exception(message, cause.orNull)
1313

1414
object Error {
1515
def fromThrowable(throwable: Throwable): Error = JsonDecoder.Error(throwable.getMessage, Some(throwable))

0 commit comments

Comments
 (0)