1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-03-03 15:02:35 +02:00

add condition to withMandatoryProperty

This commit is contained in:
Christopher Fenner 2018-07-31 15:42:27 +02:00 committed by GitHub
parent 745b6d471d
commit c5d3ed7ab8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -162,8 +162,13 @@ class ConfigurationHelper implements Serializable {
return paramValue
}
def withMandatoryProperty(key, errorMessage = null){
getMandatoryProperty(key, null, errorMessage)
def withMandatoryProperty(key, errorMessage = null, condition = null){
if(condition){
if(condition(this.config))
getMandatoryProperty(key, null, errorMessage)
}else{
getMandatoryProperty(key, null, errorMessage)
}
return this
}
}