Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing final in Condition trait #3209

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions zio-http/shared/src/main/scala/zio/http/codec/HttpCodec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2513,25 +2513,27 @@ object HttpCodec extends ContentCodecs with HeaderCodecs with MethodCodecs with
* recover from `MissingHeader` or `MissingQueryParam` errors.
*/
sealed trait Condition { self =>
def apply(cause: Cause[Any]): Boolean =
final def apply(cause: Cause[Any]): Boolean =
self match {
case Condition.IsHttpCodecError => HttpCodecError.isHttpCodecError(cause)
case Condition.isMissingDataOnly => HttpCodecError.isMissingDataOnly(cause)
}
def combine(that: Condition): Condition =
final def combine(that: Condition): Condition =
(self, that) match {
case (Condition.isMissingDataOnly, _) => Condition.isMissingDataOnly
case (_, Condition.isMissingDataOnly) => Condition.isMissingDataOnly
case _ => Condition.IsHttpCodecError
}
def isHttpCodecError: Boolean = self match {
case Condition.IsHttpCodecError => true
case _ => false
}
def isMissingDataOnly: Boolean = self match {
case Condition.isMissingDataOnly => true
case _ => false
}
final def isHttpCodecError: Boolean =
self match {
case Condition.IsHttpCodecError => true
case _ => false
}
final def isMissingDataOnly: Boolean =
self match {
case Condition.isMissingDataOnly => true
case _ => false
}
}
object Condition {
case object IsHttpCodecError extends Condition
Expand Down
Loading