fromString static method

JobMode fromString(
  1. String mode
)

Creates a JobMode from a string representation.

  • mode - String value representing the job mode

Returns the corresponding JobMode enum value.

Throws Exception if the mode string is invalid.

Supported values:

  • "build" -> JobMode.build
  • "publish" -> JobMode.publish

Implementation

static JobMode fromString(String mode) {
  switch (mode) {
    case "build":
      return JobMode.build;
    case "publish":
      return JobMode.publish;
    default:
      throw Exception("Invalid job mode");
  }
}