1
2
3
4
5
6
7
8 package net.kwfgrid.gwes.workflowanalyzer;
9
10
11
12
13
14
15 public class OperationResourcePair {
16
17 private final String operation;
18 private final String resource;
19 private int hashCode = 0;
20
21
22
23
24
25
26 public OperationResourcePair(String operation, String resource) {
27 this.operation = operation;
28 this.resource = resource;
29 }
30
31 public String getOperation() {
32 return operation;
33 }
34
35 public String getResource() {
36 return resource;
37 }
38
39 @Override
40 public boolean equals(Object o) {
41 if (this == o) return true;
42 if (o == null || getClass() != o.getClass()) return false;
43
44 OperationResourcePair that = (OperationResourcePair) o;
45
46 return !(operation != null ? !operation.equals(that.operation) : that.operation != null) && !(resource != null ? !resource.equals(that.resource) : that.resource != null);
47
48 }
49
50 @Override
51 public int hashCode() {
52 if (this.hashCode !=0) return this.hashCode;
53 int i = operation != null ? operation.hashCode() : 0;
54 i = 31 * i + (resource != null ? resource.hashCode() : 0);
55 hashCode = i;
56 return hashCode;
57 }
58
59 @Override
60 public String toString() {
61 StringBuffer buffer = new StringBuffer();
62 buffer.append('{').append(operation).append('|').append(resource).append('}');
63 return buffer.toString();
64 }
65 }