mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-03-05 15:15:44 +02:00
add condition to withMandatoryProperty
This commit is contained in:
parent
745b6d471d
commit
c5d3ed7ab8
@ -162,8 +162,13 @@ class ConfigurationHelper implements Serializable {
|
||||
return paramValue
|
||||
}
|
||||
|
||||
def withMandatoryProperty(key, errorMessage = null){
|
||||
def withMandatoryProperty(key, errorMessage = null, condition = null){
|
||||
if(condition){
|
||||
if(condition(this.config))
|
||||
getMandatoryProperty(key, null, errorMessage)
|
||||
}else{
|
||||
getMandatoryProperty(key, null, errorMessage)
|
||||
}
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user