codacy.events.internal.PathHolders.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of events-rabbitmq_2.13 Show documentation
Show all versions of events-rabbitmq_2.13 Show documentation
A library to send events on rabbit-mq
The newest version!
package codacy.events.internal
import codacy.events.{Event, PathHolder}
import shapeless.{:+:, lazily, CNil, Coproduct, Lazy}
object PathHolders {
implicit def caseCNil: PathHolders[CNil] = Impl(Set.empty)
implicit def caseCCons[H <: Event, T <: Coproduct](implicit
h: Lazy[PathHolder[H]],
t: Lazy[PathHolders[T]]
): PathHolders[H :+: T] = {
Impl(lazily[PathHolders[T]].paths + lazily[PathHolder[H]].path)
}
private case class Impl[T](paths: Set[String]) extends AnyVal with PathHolders[T]
}
sealed trait PathHolders[C] extends Any {
def paths: Set[String]
}