com.kazurayam.ks.globalvariable.xml.GlobalVariableEntities.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ExecutionProfilesLoader Show documentation
Show all versions of ExecutionProfilesLoader Show documentation
A Katalon Studio plugin that enables loading Execution Profiles in test scripts
package com.kazurayam.ks.globalvariable.xml
public final class GlobalVariableEntities {
private String description
private String name
private String tag
private Boolean defaultProfile
private List entities
GlobalVariableEntities() {
this.description = ""
this.name = ""
this.tag = ""
this.defaultProfile = false
this.entities = new ArrayList()
}
GlobalVariableEntities description(String description) {
this.description = description ?: ""
return this
}
GlobalVariableEntities name(String name) {
this.name = name ?: ""
return this
}
GlobalVariableEntities tag(String tag) {
this.tag = tag ?: ""
return this
}
GlobalVariableEntities defaultProfile(Boolean defaultProfile) {
this.defaultProfile = defaultProfile
return this
}
GlobalVariableEntities addEntity(GlobalVariableEntity entity) {
this.entities.add(entity)
return this
}
String description() {
return description
}
String name() {
return name
}
String tag() {
return tag
}
Boolean defaultProfile() {
return defaultProfile
}
List entities() {
return new ArrayList(entities)
}
boolean contains(String globalVariableName) {
int count = 0
for (GlobalVariableEntity gve in this.entities) {
if (gve.name() == globalVariableName) {
count += 1
}
}
return count > 0
}
@Override
String toString() {
StringBuilder sb = new StringBuilder()
sb.append("")
sb.append("${description} ")
sb.append("${name} ")
sb.append("${tag} ")
sb.append("${defaultProfile} ")
entities.each { entity ->
sb.append(entity.toString())
}
sb.append(" ")
return sb.toString()
}
}