|
50 | 50 | @FieldDefaults(level = PRIVATE) |
51 | 51 | public class NodeInfo implements DataSerializable { |
52 | 52 |
|
| 53 | + boolean ok; |
| 54 | + |
| 55 | + Optional<Integer> port; |
| 56 | + |
| 57 | + Optional<NodeType> type; |
| 58 | + |
| 59 | + Optional<Protocol> protocol; |
| 60 | + |
| 61 | + Optional<Version> high; |
| 62 | + |
| 63 | + Optional<Version> low; |
| 64 | + |
| 65 | + Optional<String> name; |
| 66 | + |
| 67 | + public NodeInfo () { |
| 68 | + port = empty(); |
| 69 | + type = empty(); |
| 70 | + protocol = empty(); |
| 71 | + high = empty(); |
| 72 | + low = empty(); |
| 73 | + name = empty(); |
| 74 | + } |
| 75 | + |
| 76 | + @Builder |
| 77 | + public NodeInfo (boolean ok, Integer port, NodeType type, Protocol protocol, Version high, Version low, String name) { |
| 78 | + this.ok = ok; |
| 79 | + this.port = ofNullable(port); |
| 80 | + this.type = ofNullable(type); |
| 81 | + this.protocol = ofNullable(protocol); |
| 82 | + this.high = ofNullable(high); |
| 83 | + this.low = ofNullable(low); |
| 84 | + this.name = ofNullable(name); |
| 85 | + } |
| 86 | + |
53 | 87 | @Override |
54 | 88 | public void write (@NonNull Bytes bytes) { |
55 | 89 | if (!ok) { |
@@ -86,38 +120,4 @@ public void read (@NonNull Bytes bytes) { |
86 | 120 | val length = bytes.getShort(); |
87 | 121 | name = of(bytes.getString(length, ISO_8859_1)); |
88 | 122 | } |
89 | | - |
90 | | - boolean ok; |
91 | | - |
92 | | - Optional<Integer> port; |
93 | | - |
94 | | - Optional<NodeType> type; |
95 | | - |
96 | | - Optional<Protocol> protocol; |
97 | | - |
98 | | - Optional<Version> high; |
99 | | - |
100 | | - Optional<Version> low; |
101 | | - |
102 | | - Optional<String> name; |
103 | | - |
104 | | - public NodeInfo () { |
105 | | - port = empty(); |
106 | | - type = empty(); |
107 | | - protocol = empty(); |
108 | | - high = empty(); |
109 | | - low = empty(); |
110 | | - name = empty(); |
111 | | - } |
112 | | - |
113 | | - @Builder |
114 | | - public NodeInfo (boolean ok, Integer port, NodeType type, Protocol protocol, Version high, Version low, String name) { |
115 | | - this.ok = ok; |
116 | | - this.port = ofNullable(port); |
117 | | - this.type = ofNullable(type); |
118 | | - this.protocol = ofNullable(protocol); |
119 | | - this.high = ofNullable(high); |
120 | | - this.low = ofNullable(low); |
121 | | - this.name = ofNullable(name); |
122 | | - } |
123 | 123 | } |
0 commit comments