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

dependency.ModuleLike.scala Maven / Gradle / Ivy

There is a newer version: 0.3.1
Show newest version
package dependency

final case class ModuleLike[+A <: NameAttributes](
  organization: String,
  name: String,
  nameAttributes: A,
  attributes: Map[String, String]
) {

  def applyParams(params: ScalaParameters): Module =
    copy(
      name = name + nameAttributes.suffix(params),
      nameAttributes = NoAttributes
    )

  private def attributesString: String =
    attributes.toVector.sorted.map { case (k, v) => s";$k=$v" }.mkString
  def render: String =
    render(":")
  def render(separator: String): String =
    s"$organization$separator${nameAttributes.render(name, separator)}$attributesString"
  override def toString: String =
    render
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy