1
2
3
4 package ca.uhn.hl7v2.protocol.impl;
5
6 import ca.uhn.hl7v2.protocol.ApplicationRouter;
7 import ca.uhn.hl7v2.protocol.ApplicationRouter.AppRoutingData;
8
9 import java.util.Objects;
10
11
12
13
14
15
16
17 public class AppRoutingDataImpl implements ApplicationRouter.AppRoutingData {
18
19 private final String myMessageType;
20 private final String myTriggerEvent;
21 private final String myProcessingId;
22 private final String myVersionId;
23
24
25
26
27
28 public AppRoutingDataImpl(String theMessageType, String theTriggerEvent,
29 String theProcessingId, String theVersionId) {
30 myMessageType = theMessageType;
31 myTriggerEvent = theTriggerEvent;
32 myProcessingId = theProcessingId;
33 myVersionId = theVersionId;
34 }
35
36
37
38
39 public String getMessageType() {
40 return myMessageType;
41 }
42
43
44
45
46 public String getTriggerEvent() {
47 return myTriggerEvent;
48 }
49
50
51
52
53 public String getProcessingId() {
54 return myProcessingId;
55 }
56
57
58
59
60 public String getVersion() {
61 return myVersionId;
62 }
63
64 @Override
65 public boolean equals(Object o) {
66 if (this == o) return true;
67 if (!(o instanceof AppRoutingDataImpl)) return false;
68
69 AppRoutingDataImpl./../ca/uhn/hl7v2/protocol/impl/AppRoutingDataImpl.html#AppRoutingDataImpl">AppRoutingDataImpl that = (AppRoutingDataImpl) o;
70
71 if (!Objects.equals(myMessageType, that.myMessageType))
72 return false;
73 if (!Objects.equals(myProcessingId, that.myProcessingId))
74 return false;
75 if (!Objects.equals(myTriggerEvent, that.myTriggerEvent))
76 return false;
77 return Objects.equals(myVersionId, that.myVersionId);
78 }
79
80 @Override
81 public int hashCode() {
82 int result = myMessageType != null ? myMessageType.hashCode() : 0;
83 result = 31 * result + (myTriggerEvent != null ? myTriggerEvent.hashCode() : 0);
84 result = 31 * result + (myProcessingId != null ? myProcessingId.hashCode() : 0);
85 result = 31 * result + (myVersionId != null ? myVersionId.hashCode() : 0);
86 return result;
87 }
88
89
90
91
92
93 public static AppRoutingData withAll() {
94 return new AppRoutingDataImpl("*","*", "*", "*");
95 }
96
97 }