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

scala.class_traits_mutablet.ssp Maven / Gradle / Ivy

The newest version!
<%
  // Copyright 2013 Foursquare Labs Inc. All Rights Reserved.

  import com.foursquare.spindle.codegen.runtime.StructLike
%>
<%@ val cls: StructLike %>
<%@ val clsContainer: String %>
trait Mutable${cls.name} extends ${cls.name}
    with #if(clsContainer.nonEmpty)Java${clsContainer}.#endJava${cls.name}Mutable[#if (cls.typeParameterFields.nonEmpty)${cls.typeParameterFields.map(_.text).distinct.mkString(", ")},#end<%----%>
      ${cls.name}, Raw${cls.name}, ${cls.name}Meta
    ] {
#for (field <- cls.fields)
<% render(field.renderType.fieldMutableTemplate, Map("field" -> field)) %>
#end

  def merge(that: ${cls.name}): Unit

  def copy(
      ${cls.fields.map(field => "%s: %s = %sOrNull".format(field.escapedName, field.renderType.boxedText, field.name)).mkString(",\n      ")}
  ): Mutable${cls.name}

  override def mutable: Mutable${cls.name} = this
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy