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