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

change-sysadmin-scala_3.0.1.4.source-code.stepRunBody-untemplate.scala Maven / Gradle / Ivy

The newest version!
// DO NOT HAND EDIT -- Autogenerated from 'stepRunBody.untemplate' at 2024-03-27T00:43:21.058269Z
package com.mchange.sysadmin.taskrunner

import java.io.{Writer,StringWriter}
import scala.collection.*



val Untemplate_stepRunBody = new untemplate.Untemplate[AnyStepRun,Nothing]:
  val UntemplateFunction                    : untemplate.Untemplate[AnyStepRun,Nothing] = this
  val UntemplateName                        : String = "stepRunBody"
  val UntemplatePackage                     : String = "com.mchange.sysadmin.taskrunner"
  val UntemplateInputName                   : String = "run"
  val UntemplateInputTypeDeclared           : String = "AnyStepRun"
  val UntemplateInputTypeCanonical          : Option[String] = untemplate.Macro.nonEmptyStringOption( untemplate.Macro.recursiveCanonicalName[AnyStepRun] )
  val UntemplateInputDefaultArgument        : Option[AnyStepRun] = (None : Option[AnyStepRun])
  val UntemplateOutputMetadataTypeDeclared  : String = "Nothing"
  val UntemplateOutputMetadataTypeCanonical : Option[String] = untemplate.Macro.nonEmptyStringOption( untemplate.Macro.recursiveCanonicalName[Nothing] )
  val UntemplateHeaderNote                  : String = ""

  val UntemplateAttributes : immutable.Map[String,Any] = immutable.Map.empty


  def apply(run : AnyStepRun) : untemplate.Result[Nothing] =
    val writer             : StringWriter = new StringWriter(6440)
    val attrs              : immutable.Map[String,Any] = UntemplateAttributes
    var mbMetadata         : Option[Nothing] = None
    var outputTransformer  : Function1[untemplate.Result[Nothing],untemplate.Result[Nothing]] = identity



      val block0 = new Function0[String]:
        def apply() : String =
          "\n"
      writer.write(block0())

      run match {
        case completed : AnyStepRunCompleted =>
          val block1 = new Function0[String]:
            def apply() : String =
              "" + ( mbExitCode( completed ) ) +
              "\n" + ( labeledTextOrNA("out".htmlSafeText, completed.result.stepOut.htmlSafeText).trim ) +
              "\n" + ( labeledTextOrNA("err".htmlSafeText, completed.result.stepErr.htmlSafeText).trim ) +
              "\n" + ( mbLabeledText( completed.result.notes.map( n => ("notes".htmlSafeText, n.htmlSafeText) ) ) ) +
              "\n" + ( mbLabeledText( completed.result.carryForwardDescription.map( cfd => ("carryforward".htmlSafeText, cfd.htmlSafeText) ) ) ) +
              "\n"
          writer.write(block1())

        case skipped : AnyStepRunSkipped =>
          val block2 = new Function0[String]:
            def apply() : String =
              "
SKIPPED
\n" writer.write(block2()) } outputTransformer( untemplate.Result( mbMetadata, writer.toString ) ) end apply end Untemplate_stepRunBody def stepRunBody(run : AnyStepRun) : untemplate.Result[Nothing] = Untemplate_stepRunBody( run )




© 2015 - 2025 Weber Informatics LLC | Privacy Policy