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

scalapb.compiler.ConstructorField.scala Maven / Gradle / Ivy

The newest version!
package scalapb.compiler

case class ConstructorField(
    name: String,
    typeName: String,
    default: Option[String],
    annotations: Seq[String] = Nil
) {
  def fullString: String =
    Seq(
      s"${if (annotations.isEmpty) "" else annotations.mkString("", " ", " ")}",
      s"${name}: ${typeName}",
      default.fold("")(" = " + _)
    ).mkString

  def nameAndType: String = s"${name}: ${typeName}"
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy