1
2
3
4
5 package org.epics.pvmanager;
6
7
8
9
10
11
12
13
14
15
16 public class ChannelHandlerReadSubscription {
17
18
19
20
21
22
23
24
25 public ChannelHandlerReadSubscription(ValueCache<?> valueCache, WriteFunction<Exception> exceptionWriteFunction, WriteFunction<Boolean> connectionWriteFunction) {
26 this.valueCache = valueCache;
27 this.exceptionWriteFunction = exceptionWriteFunction;
28 this.connectionWriteFunction = connectionWriteFunction;
29 }
30
31 private final ValueCache<?> valueCache;
32 private final WriteFunction<Exception> exceptionWriteFunction;
33 private final WriteFunction<Boolean> connectionWriteFunction;
34
35
36
37
38
39
40 public ValueCache<?> getValueCache() {
41 return valueCache;
42 }
43
44
45
46
47
48
49 public WriteFunction<Exception> getExceptionWriteFunction() {
50 return exceptionWriteFunction;
51 }
52
53
54
55
56
57
58 public WriteFunction<Boolean> getConnectionWriteFunction() {
59 return connectionWriteFunction;
60 }
61
62 @Override
63 public int hashCode() {
64 int hash = 5;
65 hash = 67 * hash + (this.valueCache != null ? this.valueCache.hashCode() : 0);
66 hash = 67 * hash + (this.exceptionWriteFunction != null ? this.exceptionWriteFunction.hashCode() : 0);
67 hash = 67 * hash + (this.connectionWriteFunction != null ? this.connectionWriteFunction.hashCode() : 0);
68 return hash;
69 }
70
71 @Override
72 public boolean equals(Object obj) {
73 if (obj == null) {
74 return false;
75 }
76 if (getClass() != obj.getClass()) {
77 return false;
78 }
79 final ChannelHandlerReadSubscription other = (ChannelHandlerReadSubscription) obj;
80 if (this.valueCache != other.valueCache && (this.valueCache == null || !this.valueCache.equals(other.valueCache))) {
81 return false;
82 }
83 if (this.exceptionWriteFunction != other.exceptionWriteFunction && (this.exceptionWriteFunction == null || !this.exceptionWriteFunction.equals(other.exceptionWriteFunction))) {
84 return false;
85 }
86 if (this.connectionWriteFunction != other.connectionWriteFunction && (this.connectionWriteFunction == null || !this.connectionWriteFunction.equals(other.connectionWriteFunction))) {
87 return false;
88 }
89 return true;
90 }
91
92 }