com.runsidekick.broker.model.ApplicationTags Maven / Gradle / Ivy
package com.runsidekick.broker.model;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
* @author serkan.ozal
*/
public class ApplicationTags {
private Set applicationNames;
private Set applicationVersions;
private Set applicationStages;
private Map> applicationCustomTags;
public ApplicationTags() {
this.applicationCustomTags = new HashMap<>();
}
public Set getApplicationNames() {
return applicationNames;
}
public void setApplicationNames(Set applicationNames) {
this.applicationNames = applicationNames;
}
public Set getApplicationVersions() {
return applicationVersions;
}
public void setApplicationVersions(Set applicationVersions) {
this.applicationVersions = applicationVersions;
}
public Set getApplicationStages() {
return applicationStages;
}
public void setApplicationStages(Set applicationStages) {
this.applicationStages = applicationStages;
}
public Map> getApplicationCustomTags() {
return applicationCustomTags;
}
public void setApplicationCustomTags(Map> applicationCustomTags) {
this.applicationCustomTags = applicationCustomTags;
}
public void addApplicationCustomTag(String tagName, String tagValue) {
if (applicationCustomTags.containsKey(tagName)) {
applicationCustomTags.get(tagName).add(tagValue);
} else {
Set tagValues = new HashSet<>();
tagValues.add(tagValue);
applicationCustomTags.put(tagName, tagValues);
}
}
public void removeApplicationCustomTag(String tagName, String tagValue) {
if (applicationCustomTags.containsKey(tagName)) {
Set values = applicationCustomTags.get(tagName);
values.remove(tagValue);
}
}
@Override
public String toString() {
return "ApplicationTags{" +
"applicationNames=" + applicationNames +
", applicationCustomTags=" + applicationCustomTags +
", applicationVersions=" + applicationVersions +
", applicationStages=" + applicationStages +
'}';
}
}