01: package net.sourceforge.cruisecontrol.sourcecontrols;
02:
03: import java.io.Serializable;
04: import java.util.HashMap;
05: import java.util.Map;
06:
07: public class SourceControlProperties implements Serializable {
08:
09: private static final long serialVersionUID = -8991634210894755397L;
10:
11: private String property;
12: private String propertyOnDelete;
13: private Map properties = new HashMap();
14:
15: public Map getPropertiesAndReset() {
16: Map lvalue = new HashMap();
17: lvalue.putAll(properties);
18: properties.clear();
19: return lvalue;
20: }
21:
22: public void assignPropertyName(String propertyName) {
23: property = propertyName;
24: }
25:
26: public void assignPropertyOnDeleteName(String propertyName) {
27: propertyOnDelete = propertyName;
28: }
29:
30: public void modificationFound() {
31: if (property != null) {
32: properties.put(property, "true");
33: }
34: }
35:
36: public void deletionFound() {
37: if (propertyOnDelete != null) {
38: properties.put(propertyOnDelete, "true");
39: }
40: }
41:
42: public void put(String key, String value) {
43: properties.put(key, value);
44: }
45:
46: public void putAll(Map moreProperties) {
47: properties.putAll(moreProperties);
48: }
49: }
|