1 package org.opentrafficsim.sim0mq.kpi;
2
3 import org.opentrafficsim.kpi.interfaces.GtuTypeDataInterface;
4
5
6
7
8
9
10
11
12
13
14
15 public class GtuTypeData implements GtuTypeDataInterface
16 {
17
18 private final String gtuTypeName;
19
20
21
22
23 public GtuTypeData(final String gtuTypeName)
24 {
25 this.gtuTypeName = gtuTypeName;
26 }
27
28
29
30
31 public final String getGtuTypeName()
32 {
33 return this.gtuTypeName;
34 }
35
36
37 @Override
38 public String getId()
39 {
40 return this.gtuTypeName;
41 }
42
43
44 @Override
45 public int hashCode()
46 {
47 final int prime = 31;
48 int result = 1;
49 result = prime * result + ((this.gtuTypeName == null) ? 0 : this.gtuTypeName.hashCode());
50 return result;
51 }
52
53
54 @Override
55 public boolean equals(Object obj)
56 {
57 if (this == obj)
58 return true;
59 if (obj == null)
60 return false;
61 if (getClass() != obj.getClass())
62 return false;
63 GtuTypeData other = (GtuTypeData) obj;
64 if (this.gtuTypeName == null)
65 {
66 if (other.gtuTypeName != null)
67 return false;
68 }
69 else if (!this.gtuTypeName.equals(other.gtuTypeName))
70 return false;
71 return true;
72 }
73
74
75 @Override
76 public String toString()
77 {
78 return "GtuTypeData [gtuTypeName=" + this.gtuTypeName + "]";
79 }
80
81 }