1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.exoplatform.services.cms.clipboard.jcr.model;
18
19 public class ClipboardCommand {
20
21 public static final String COPY = "copy";
22
23 public static final String CUT = "cut";
24
25 public static final String ADDSYMLINK = "AddSymLink";
26
27 private String type;
28
29 private String srcPath;
30
31 private String wsName = null;
32
33 public ClipboardCommand() {}
34
35 public ClipboardCommand(String type, String path, String ws) {
36 this.type = type;
37 this.srcPath = path;
38 this.wsName = ws;
39 }
40
41 public String getSrcPath() {
42 return srcPath;
43 }
44
45 public void setSrcPath(String srcPath) {
46 this.srcPath = srcPath;
47 }
48
49 public String getType() {
50 return type;
51 }
52
53 public void setType(String type) {
54 this.type = type;
55 }
56
57 public void setWorkspace(String ws) {
58 wsName = ws;
59 }
60
61 public String getWorkspace() {
62 return wsName;
63 }
64
65 public int hashCode() {
66 int ret = 0;
67 if (type != null) ret += type.hashCode();
68 if (wsName != null) ret += wsName.hashCode();
69 if (srcPath != null) ret += srcPath.hashCode();
70 return ret;
71 }
72
73 public boolean equals(Object o) {
74 if (o != null && o instanceof ClipboardCommand) {
75 ClipboardCommand cObject = ClipboardCommand.class.cast(o);
76 if (wsName == null && cObject.wsName != null || wsName != null && cObject.wsName == null) return false;
77 if (srcPath == null && cObject.srcPath != null || srcPath != null && cObject.srcPath == null) return false;
78 return ((wsName == null && cObject.wsName == null) || (wsName.equals(cObject.wsName))) &&
79 ((srcPath == null && cObject.srcPath == null) || (srcPath.equals(cObject.srcPath)));
80 } else {
81 return false;
82 }
83 }
84 }