1 package org.opentrafficsim.kpi.sampling.meta;
2
3 import org.djutils.exceptions.Throw;
4 import org.opentrafficsim.kpi.interfaces.GtuDataInterface;
5 import org.opentrafficsim.kpi.interfaces.NodeDataInterface;
6
7
8
9
10
11
12
13
14
15
16
17
18 public class MetaDataDestination extends MetaDataType<NodeDataInterface>
19 {
20
21
22
23
24 public MetaDataDestination()
25 {
26 super("destination");
27 }
28
29
30 @Override
31 public final NodeDataInterface getValue(final GtuDataInterface gtu)
32 {
33 Throw.whenNull(gtu, "GTU may not be null.");
34 return gtu.getDestinationNodeData();
35 }
36
37
38 @Override
39 public String formatValue(String format, NodeDataInterface value)
40 {
41 return value.getId();
42 }
43
44
45 @Override
46 @SuppressWarnings("checkstyle:designforextension")
47 public String toString()
48 {
49 return "MetaDataDestination: [id=" + getId() + "]";
50 }
51
52 }