1 package net.sf.snmpadaptor4j.core.mapping;
2
3 import java.io.Serializable;
4 import net.sf.snmpadaptor4j.object.SnmpDataType;
5 import net.sf.snmpadaptor4j.object.SnmpOid;
6
7
8
9
10
11
12
13 public final class UserDataEntryDataMapTrapMapping
14 implements Serializable {
15
16
17
18
19 private static final long serialVersionUID = -520862990459987242L;
20
21
22
23
24 private final String key;
25
26
27
28
29 private final SnmpDataType type;
30
31
32
33
34 private final SnmpOid oid;
35
36
37
38
39
40
41
42
43
44 UserDataEntryDataMapTrapMapping (final String key, final SnmpDataType type, final SnmpOid oid) {
45 super();
46 this.key = key;
47 this.type = type;
48 this.oid = oid;
49 }
50
51
52
53
54
55 public String getKey () {
56 return this.key;
57 }
58
59
60
61
62
63 public SnmpDataType getType () {
64 return this.type;
65 }
66
67
68
69
70
71 public SnmpOid getOid () {
72 return this.oid;
73 }
74
75
76
77
78
79 @Override
80 public int hashCode () {
81 final int prime = 31;
82 int result = 1;
83 result = prime * result + ((this.key == null) ? 0 : this.key.hashCode());
84 result = prime * result + ((this.oid == null) ? 0 : this.oid.hashCode());
85 result = prime * result + ((this.type == null) ? 0 : this.type.hashCode());
86 return result;
87 }
88
89
90
91
92
93 @Override
94 public boolean equals (final Object obj) {
95 boolean result = false;
96 if (obj == this) {
97 result = true;
98 }
99 else if ((obj != null) && getClass().equals(obj.getClass())) {
100 final UserDataEntryDataMapTrapMapping other = (UserDataEntryDataMapTrapMapping) obj;
101 result = (this.type == other.type);
102 if (result) {
103 result = (this.oid != null ? this.oid.equals(other.oid) : other.oid == null);
104 }
105 if (result) {
106 result = (this.key != null ? this.key.equals(other.key) : other.key == null);
107 }
108 }
109 return result;
110 }
111
112
113
114
115
116 @Override
117 public String toString () {
118 return "UserDataEntryDataMapTrapMapping[key=" + this.key + "; type=" + this.type + "; oid=" + this.oid + "]";
119 }
120
121 }