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

scala.class_traits_tobuilder.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 %>
  def toBuilder(): ${cls.name}.Builder.AllSpecified = {
    val ret = new ${cls.name}.Builder(${cls.name}.createRawRecord)
#for (field <- cls.fields)
#if (field.renderType.isNullable)
    if (${field.isSetName}) ret.${field.escapedName}(${field.name}OrNull)
#else
    if (${field.isSetName}) ret.${field.escapedName}(${field.name}OrDefault)
#end
#end
    ret
  }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy