1 package net.sf.snmpadaptor4j.core.mapping;
2
3 import java.io.Serializable;
4 import net.sf.snmpadaptor4j.object.SnmpOid;
5
6
7
8
9
10 public abstract class SnmpTrapMapping
11 implements Serializable {
12
13
14
15
16 private static final long serialVersionUID = -3245663684853609245L;
17
18
19
20
21 private final SnmpOid source;
22
23
24
25
26 private final DataMapTrapMapping dataMap;
27
28
29
30
31
32
33 protected SnmpTrapMapping (final SnmpOid source, final DataMapTrapMapping dataMap) {
34 super();
35 this.source = source;
36 this.dataMap = dataMap;
37 }
38
39
40
41
42
43 public final SnmpOid getSource () {
44 return this.source;
45 }
46
47
48
49
50
51 public final DataMapTrapMapping getDataMap () {
52 return this.dataMap;
53 }
54
55
56
57
58
59 @Override
60 public int hashCode () {
61 final int prime = 31;
62 int result = 1;
63 result = prime * result + ((this.dataMap == null) ? 0 : this.dataMap.hashCode());
64 result = prime * result + ((this.source == null) ? 0 : this.source.hashCode());
65 return result;
66 }
67
68
69
70
71
72 @Override
73 public boolean equals (final Object obj) {
74 boolean result = false;
75 if ((obj != null) && getClass().equals(obj.getClass())) {
76 final SnmpTrapMapping other = (SnmpTrapMapping) obj;
77 result = (this.source != null ? this.source.equals(other.source) : (other.source == null));
78 if (result) {
79 result = (this.dataMap != null ? this.dataMap.equals(other.dataMap) : (other.dataMap == null));
80 }
81 }
82 return result;
83 }
84
85 }