github.com/ouraigua/jenkins-library@v0.0.0-20231028010029-fbeaf2f3aa9b/src/com/sap/piper/tools/neo/DeployMode.groovy (about)

     1  package com.sap.piper.tools.neo
     2  
     3  enum DeployMode {
     4      MTA('mta'), WAR_PARAMS('warParams'), WAR_PROPERTIES_FILE('warPropertiesFile')
     5  
     6      private String value
     7  
     8      DeployMode(String value) {
     9          this.value = value
    10      }
    11  
    12      static Set stringValues() {
    13          return values().collect { each -> each.value } as Set
    14      }
    15  
    16      boolean isWarDeployment() {
    17          return this != DeployMode.MTA
    18      }
    19  
    20      static DeployMode fromString(String value) {
    21          DeployMode enumValue = values().find { each -> each.value == value }
    22  
    23          if (enumValue == null) {
    24              throw new IllegalArgumentException("${value} is not in the list of possible values ${stringValues()}")
    25          }
    26  
    27          return enumValue
    28      }
    29  }