All Downloads are FREE. Search and download functionalities are using the official Maven repository.

codacy.events.Topic.scala Maven / Gradle / Ivy

The newest version!
package codacy.events

final case class Topic(parts: List[TopicPart]) extends AnyVal {
  def routingKey = parts.map(_.value).mkString(".")
}

object Topic {

  trait Components[M[_]] extends Any {
    def topics: M[Set[Topic]]
  }
}

final case class ComponentName(value: String) extends AnyVal

object ComponentName {

  trait Components[M[_]] extends Any {
    def componentName: M[ComponentName]
  }
}

sealed abstract class TopicPart(val value: String)

object TopicPart {
  def apply(value: String): TopicPart = Named(value)
  def wildcard: TopicPart = `*`
  def hashtag: TopicPart = `#`

  case object `#` extends TopicPart("#")
  case object `*` extends TopicPart("*")
  final case class Named(v: String) extends TopicPart(v)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy