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