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

io.github.arainko.ducktape.internal.ConfigInstructionRefiner.scala Maven / Gradle / Ivy

There is a newer version: 0.2.5
Show newest version
package io.github.arainko.ducktape.internal

import io.github.arainko.ducktape.*
import io.github.arainko.ducktape.internal.Configuration.*

private[ducktape] object ConfigInstructionRefiner {

  def run[F <: Fallible](instruction: Configuration.Instruction[F]): Configuration.Instruction[Nothing] | None.type =
    instruction match
      case inst @ Instruction.Static(_, _, config, _) =>
        config match
          case cfg: (Const | CaseComputed | FieldComputed | FieldReplacement)           => inst.copy(config = cfg)
          case fallible: (FallibleConst | FallibleFieldComputed | FallibleCaseComputed) => None
      case inst: (Instruction.Dynamic | Instruction.Bulk | Instruction.Regional | Instruction.Failed) => inst

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy