1 package org.rundeck.api.domain;
2
3 import java.io.Serializable;
4 import java.util.LinkedHashMap;
5 import java.util.Map;
6
7
8
9
10
11
12
13 public class ProjectConfig implements Serializable {
14
15 private static final long serialVersionUID = 1L;
16 private LinkedHashMap<String, String> properties = new LinkedHashMap<String, String>();
17
18 public ProjectConfig() {
19 }
20
21 public ProjectConfig(Map<String, String> properties) {
22 setProperties(properties);
23 }
24
25 public void setProperty(final String key, final String value) {
26 getProperties().put(key, value);
27 }
28
29 public void addProperties(final Map<String, String> values) {
30 getProperties().putAll(values);
31 }
32
33 public Map<String, String> getProperties() {
34 return properties;
35 }
36
37 public void setProperties(final Map<String, String> properties) {
38 this.properties = new LinkedHashMap<String, String>(properties);
39 }
40
41 @Override
42 public boolean equals(Object o) {
43 if (this == o) return true;
44 if (!(o instanceof ProjectConfig)) return false;
45
46 ProjectConfig that = (ProjectConfig) o;
47
48 if (properties != null ? !properties.equals(that.properties) : that.properties != null) return false;
49
50 return true;
51 }
52
53 @Override
54 public int hashCode() {
55 return properties != null ? properties.hashCode() : 0;
56 }
57
58 @Override
59 public String toString() {
60 return "ProjectConfig{" +
61 "properties=" + properties +
62 '}';
63 }
64 }