RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
NetworkTablesTelemetryBackend.java
1// TODO - RobotCore - Modified
2
3// Copyright (c) FIRST and other WPILib contributors.
4// Open Source Software; you can modify and/or share it under the terms of
5// the WPILib BSD license file in the root directory of this project.
6
7package org.wpilib.backend;
8
9import org.wpilib.networktables.NetworkTableInstance;
10import org.wpilib.telemetry.TelemetryBackend;
11import org.wpilib.telemetry.TelemetryEntry;
12
13
14// import io.avaje.json.JsonException;
15// import io.avaje.jsonb.JsonType;
16// import io.avaje.jsonb.Jsonb;
17// import java.io.IOException;
18// import java.util.HashMap;
19// import java.util.Map;
20// import org.wpilib.networktables.BooleanArrayPublisher;
21// import org.wpilib.networktables.BooleanPublisher;
22// import org.wpilib.networktables.DoubleArrayPublisher;
23// import org.wpilib.networktables.DoublePublisher;
24// import org.wpilib.networktables.FloatArrayPublisher;
25// import org.wpilib.networktables.FloatPublisher;
26// import org.wpilib.networktables.IntegerArrayPublisher;
27// import org.wpilib.networktables.IntegerPublisher;
28// import org.wpilib.networktables.NetworkTableInstance;
29// import org.wpilib.networktables.NetworkTableType;
30// import org.wpilib.networktables.PubSubOption;
31// import org.wpilib.networktables.Publisher;
32// import org.wpilib.networktables.RawPublisher;
33// import org.wpilib.networktables.StringArrayPublisher;
34// import org.wpilib.networktables.StringPublisher;
35// import org.wpilib.telemetry.TelemetryBackend;
36// import org.wpilib.telemetry.TelemetryEntry;
37// import org.wpilib.telemetry.TelemetryRegistry;
38// import org.wpilib.util.protobuf.Protobuf;
39// import org.wpilib.util.protobuf.ProtobufBuffer;
40// import org.wpilib.util.struct.Struct;
41// import org.wpilib.util.struct.StructBuffer;
42
44public class NetworkTablesTelemetryBackend implements TelemetryBackend {
45 public NetworkTablesTelemetryBackend(NetworkTableInstance inst, String prefix) {
46 }
47 // private static final Jsonb s_json = Jsonb.instance();
48 // private static final JsonType<Object> s_jsonValue = s_json.type(Object.class);
49
50 @Override
51 public void close() throws Exception {
52 // TODO Auto-generated method stub
53 throw new UnsupportedOperationException("Unimplemented method 'NetworkTablesTelementryBackend.close'");
54 }
55
56 @Override
57 public TelemetryEntry getEntry(String path) {
58 // TODO Auto-generated method stub
59 throw new UnsupportedOperationException("Unimplemented method 'getEntry'");
60 }
61
62 // private final NetworkTableInstance m_inst;
63 // private final String m_prefix;
64 // private final Map<String, Entry> m_entries = new HashMap<>();
65
66 // /**
67 // * Construct.
68 // *
69 // * @param inst NetworkTables instance
70 // * @param prefix prefix to put in front of logged path in NT
71 // */
72 // public NetworkTablesTelemetryBackend(NetworkTableInstance inst, String prefix) {
73 // m_inst = inst;
74 // m_prefix = prefix;
75 // }
76
77 // @Override
78 // public void close() {
79 // synchronized (m_entries) {
80 // for (Entry entry : m_entries.values()) {
81 // entry.close();
82 // }
83 // m_entries.clear();
84 // }
85 // }
86
87 // @Override
88 // public TelemetryEntry getEntry(String name) {
89 // synchronized (m_entries) {
90 // return m_entries.computeIfAbsent(name, k -> new Entry(m_inst, m_prefix + k));
91 // }
92 // }
93
94 // private static boolean isValidPropertyJson(String value) {
95 // try {
96 // s_jsonValue.fromJson(value);
97 // return true;
98 // } catch (JsonException e) {
99 // return false;
100 // }
101 // }
102
103 // @Override
104 // public void removeEntry(String path) {
105 // Entry entry;
106 // synchronized (m_entries) {
107 // entry = m_entries.remove(path);
108 // }
109 // if (entry != null) {
110 // entry.close();
111 // }
112 // }
113
114 // @SuppressWarnings({
115 // "PMD.AvoidArrayLoops",
116 // "PMD.AvoidCatchingGenericException",
117 // "PMD.SingularField",
118 // "PMD.TooFewBranchesForSwitch"
119 // })
120 // private static final class Entry implements TelemetryEntry {
121 // private final NetworkTableInstance m_inst;
122 // private final String m_path;
123 // private volatile Publisher m_pub;
124 // private volatile boolean m_closed;
125 // private volatile String m_typeString;
126 // private volatile boolean m_keepDuplicates;
127 // private final Map<String, String> m_propertiesMap = new HashMap<>();
128 // private String m_properties = "{}";
129 // private Struct<?> m_struct;
130 // private StructBuffer<?> m_structBuffer;
131 // private Protobuf<?, ?> m_proto;
132 // private ProtobufBuffer<?, ?> m_protoBuffer;
133
134 // Entry(NetworkTableInstance inst, String path) {
135 // m_inst = inst;
136 // m_path = path;
137 // }
138
139 // public void close() {
140 // Publisher pub;
141 // synchronized (this) {
142 // pub = m_pub;
143 // m_pub = null;
144 // m_closed = true;
145 // }
146 // if (pub != null) {
147 // pub.close();
148 // }
149 // }
150
151 // @Override
152 // public boolean isDiscard() {
153 // return m_closed;
154 // }
155
156 // @Override
157 // public void keepDuplicates() {
158 // Publisher oldPub = null;
159 // synchronized (this) {
160 // if (m_closed) {
161 // return;
162 // }
163 // if (m_keepDuplicates) {
164 // return;
165 // }
166 // m_keepDuplicates = true;
167
168 // Publisher pub = m_pub;
169 // if (pub != null) {
170 // Publisher newPub = republish(pub);
171 // if (newPub != null && newPub.isValid()) {
172 // m_pub = newPub;
173 // oldPub = pub;
174 // } else if (newPub != null) {
175 // newPub.close();
176 // }
177 // }
178 // }
179 // if (oldPub != null) {
180 // oldPub.close();
181 // }
182 // }
183
184 // private Publisher republish(Publisher pub) {
185 // return switch (pub) {
186 // case BooleanPublisher ignored ->
187 // m_inst
188 // .getBooleanTopic(m_path)
189 // .publishEx(
190 // NetworkTableType.BOOLEAN.getValueStr(),
191 // m_properties,
192 // PubSubOption.KEEP_DUPLICATES);
193 // case IntegerPublisher ignored ->
194 // m_inst
195 // .getIntegerTopic(m_path)
196 // .publishEx(
197 // NetworkTableType.INTEGER.getValueStr(),
198 // m_properties,
199 // PubSubOption.KEEP_DUPLICATES);
200 // case FloatPublisher ignored ->
201 // m_inst
202 // .getFloatTopic(m_path)
203 // .publishEx(
204 // NetworkTableType.FLOAT.getValueStr(),
205 // m_properties,
206 // PubSubOption.KEEP_DUPLICATES);
207 // case DoublePublisher ignored ->
208 // m_inst
209 // .getDoubleTopic(m_path)
210 // .publishEx(
211 // NetworkTableType.DOUBLE.getValueStr(),
212 // m_properties,
213 // PubSubOption.KEEP_DUPLICATES);
214 // case StringPublisher ignored ->
215 // m_inst
216 // .getStringTopic(m_path)
217 // .publishEx(m_typeString, m_properties, PubSubOption.KEEP_DUPLICATES);
218 // case BooleanArrayPublisher ignored ->
219 // m_inst
220 // .getBooleanArrayTopic(m_path)
221 // .publishEx(
222 // NetworkTableType.BOOLEAN_ARRAY.getValueStr(),
223 // m_properties,
224 // PubSubOption.KEEP_DUPLICATES);
225 // case IntegerArrayPublisher ignored ->
226 // m_inst
227 // .getIntegerArrayTopic(m_path)
228 // .publishEx(
229 // NetworkTableType.INTEGER_ARRAY.getValueStr(),
230 // m_properties,
231 // PubSubOption.KEEP_DUPLICATES);
232 // case FloatArrayPublisher ignored ->
233 // m_inst
234 // .getFloatArrayTopic(m_path)
235 // .publishEx(
236 // NetworkTableType.FLOAT_ARRAY.getValueStr(),
237 // m_properties,
238 // PubSubOption.KEEP_DUPLICATES);
239 // case DoubleArrayPublisher ignored ->
240 // m_inst
241 // .getDoubleArrayTopic(m_path)
242 // .publishEx(
243 // NetworkTableType.DOUBLE_ARRAY.getValueStr(),
244 // m_properties,
245 // PubSubOption.KEEP_DUPLICATES);
246 // case StringArrayPublisher ignored ->
247 // m_inst
248 // .getStringArrayTopic(m_path)
249 // .publishEx(
250 // NetworkTableType.STRING_ARRAY.getValueStr(),
251 // m_properties,
252 // PubSubOption.KEEP_DUPLICATES);
253 // case RawPublisher ignored ->
254 // m_inst
255 // .getRawTopic(m_path)
256 // .publishEx(m_typeString, m_properties, PubSubOption.KEEP_DUPLICATES);
257 // default -> null;
258 // };
259 // }
260
261 // synchronized void refreshProperties() {
262 // StringBuilder sb = new StringBuilder();
263 // sb.append('{');
264 // m_propertiesMap.forEach(
265 // (k, v) -> {
266 // sb.append(s_json.toJson(k)).append(':').append(v).append(',');
267 // });
268 // // replace the trailing comma with a }
269 // sb.setCharAt(sb.length() - 1, '}');
270 // m_properties = sb.toString();
271 // }
272
273 // @Override
274 // public void setProperty(String key, String value) {
275 // if (m_closed) {
276 // return;
277 // }
278 // if (!isValidPropertyJson(value)) {
279 // TelemetryRegistry.reportWarning(m_path, "invalid property JSON");
280 // return;
281 // }
282 // synchronized (this) {
283 // if (m_closed) {
284 // return;
285 // }
286 // String oldValue = m_propertiesMap.put(key, value);
287 // if (!value.equals(oldValue)) {
288 // refreshProperties();
289 // Publisher pub = m_pub;
290 // if (pub != null) {
291 // pub.getTopic().setProperties(m_properties);
292 // }
293 // }
294 // }
295 // }
296
297 // private <T> RawPublisher initStruct(Struct<T> struct, boolean array) {
298 // if (m_closed) {
299 // return null;
300 // }
301 // String typeString = array ? struct.getTypeString() + "[]" : struct.getTypeString();
302 // Publisher pub = m_pub;
303 // return switch (pub) {
304 // case null -> {
305 // m_inst.addSchema(struct);
306 // final RawPublisher p =
307 // m_inst
308 // .getRawTopic(m_path)
309 // .publishEx(
310 // typeString, m_properties, new PubSubOption.KeepDuplicates(m_keepDuplicates));
311 // m_struct = struct;
312 // m_structBuffer = StructBuffer.create(struct);
313 // m_typeString = typeString;
314 // m_pub = p;
315 // yield p;
316 // }
317 // case RawPublisher p when typeString.equals(m_typeString) && struct.equals(m_struct) -> p;
318 // default -> null;
319 // };
320 // }
321
322 // @Override
323 // public <T> void logStruct(T value, Struct<? super T> struct, long timestamp) {
324 // boolean typeMismatch = false;
325 // try {
326 // synchronized (this) {
327 // RawPublisher pub = initStruct(struct, false);
328 // if (pub != null) {
329 // @SuppressWarnings("unchecked")
330 // StructBuffer<T> buffer = (StructBuffer<T>) m_structBuffer;
331 // var bb = buffer.write(value);
332 // pub.set(bb, 0, bb.position(), timestamp);
333 // } else if (!m_closed) {
334 // typeMismatch = true;
335 // }
336 // }
337 // } catch (RuntimeException e) {
338 // reportWarning("failed to publish struct value", e);
339 // return;
340 // }
341 // if (typeMismatch) {
342 // TelemetryRegistry.reportWarning(m_path, "type mismatch");
343 // }
344 // }
345
346 // private <T> RawPublisher initProtobuf(Protobuf<T, ?> proto) {
347 // if (m_closed) {
348 // return null;
349 // }
350 // String typeString = proto.getTypeString();
351 // Publisher pub = m_pub;
352 // return switch (pub) {
353 // case null -> {
354 // m_inst.addSchema(proto);
355 // final RawPublisher p =
356 // m_inst
357 // .getRawTopic(m_path)
358 // .publishEx(
359 // typeString, m_properties, new PubSubOption.KeepDuplicates(m_keepDuplicates));
360 // m_proto = proto;
361 // m_protoBuffer = ProtobufBuffer.create(proto);
362 // m_typeString = typeString;
363 // m_pub = p;
364 // yield p;
365 // }
366 // case RawPublisher p when typeString.equals(m_typeString) && proto.equals(m_proto) -> p;
367 // default -> null;
368 // };
369 // }
370
371 // @Override
372 // public <T> void logProtobuf(T value, Protobuf<? super T, ?> proto, long timestamp) {
373 // boolean typeMismatch = false;
374 // try {
375 // synchronized (this) {
376 // RawPublisher pub = initProtobuf(proto);
377 // if (pub != null) {
378 // @SuppressWarnings("unchecked")
379 // ProtobufBuffer<T, ?> buffer = (ProtobufBuffer<T, ?>) m_protoBuffer;
380 // var bb = buffer.write(value);
381 // pub.set(bb, 0, bb.position(), timestamp);
382 // } else if (!m_closed) {
383 // typeMismatch = true;
384 // }
385 // }
386 // } catch (IOException | RuntimeException e) {
387 // reportWarning("failed to publish protobuf value", e);
388 // return;
389 // }
390 // if (typeMismatch) {
391 // TelemetryRegistry.reportWarning(m_path, "type mismatch");
392 // }
393 // }
394
395 // @Override
396 // public <T> void logStructArray(T[] value, Struct<? super T> struct, long timestamp) {
397 // boolean typeMismatch = false;
398 // try {
399 // synchronized (this) {
400 // RawPublisher pub = initStruct(struct, true);
401 // if (pub != null) {
402 // @SuppressWarnings("unchecked")
403 // StructBuffer<T> buffer = (StructBuffer<T>) m_structBuffer;
404 // var bb = buffer.writeArray(value);
405 // pub.set(bb, 0, bb.position(), timestamp);
406 // } else if (!m_closed) {
407 // typeMismatch = true;
408 // }
409 // }
410 // } catch (RuntimeException e) {
411 // reportWarning("failed to publish struct array value", e);
412 // return;
413 // }
414 // if (typeMismatch) {
415 // TelemetryRegistry.reportWarning(m_path, "type mismatch");
416 // }
417 // }
418
419 // private void reportWarning(String msg, Exception exception) {
420 // String exceptionMessage = exception.getMessage();
421 // TelemetryRegistry.reportWarning(
422 // m_path, exceptionMessage == null ? msg : msg + ": " + exceptionMessage);
423 // }
424
425 // @Override
426 // public void logBoolean(boolean value, long timestamp) {
427 // Publisher pub = m_pub;
428 // if (pub == null) {
429 // synchronized (this) {
430 // if (m_closed) {
431 // return;
432 // }
433 // // double-check
434 // pub = m_pub;
435 // if (pub == null) {
436 // pub =
437 // m_inst
438 // .getBooleanTopic(m_path)
439 // .publishEx(
440 // NetworkTableType.BOOLEAN.getValueStr(),
441 // m_properties,
442 // new PubSubOption.KeepDuplicates(m_keepDuplicates));
443 // m_pub = pub;
444 // }
445 // }
446 // }
447
448 // switch (pub) {
449 // case BooleanPublisher e -> e.set(value, timestamp);
450 // default -> TelemetryRegistry.reportWarning(m_path, "type mismatch");
451 // }
452 // }
453
454 // @Override
455 // public void logLong(long value, long timestamp) {
456 // Publisher pub = m_pub;
457 // if (pub == null) {
458 // synchronized (this) {
459 // if (m_closed) {
460 // return;
461 // }
462 // // double-check
463 // pub = m_pub;
464 // if (pub == null) {
465 // pub =
466 // m_inst
467 // .getIntegerTopic(m_path)
468 // .publishEx(
469 // NetworkTableType.INTEGER.getValueStr(),
470 // m_properties,
471 // new PubSubOption.KeepDuplicates(m_keepDuplicates));
472 // m_pub = pub;
473 // }
474 // }
475 // }
476
477 // switch (pub) {
478 // case IntegerPublisher e -> e.set(value, timestamp);
479 // default -> TelemetryRegistry.reportWarning(m_path, "type mismatch");
480 // }
481 // }
482
483 // @Override
484 // public void logFloat(float value, long timestamp) {
485 // Publisher pub = m_pub;
486 // if (pub == null) {
487 // synchronized (this) {
488 // if (m_closed) {
489 // return;
490 // }
491 // // double-check
492 // pub = m_pub;
493 // if (pub == null) {
494 // pub =
495 // m_inst
496 // .getFloatTopic(m_path)
497 // .publishEx(
498 // NetworkTableType.FLOAT.getValueStr(),
499 // m_properties,
500 // new PubSubOption.KeepDuplicates(m_keepDuplicates));
501 // m_pub = pub;
502 // }
503 // }
504 // }
505
506 // switch (pub) {
507 // case FloatPublisher e -> e.set(value, timestamp);
508 // default -> TelemetryRegistry.reportWarning(m_path, "type mismatch");
509 // }
510 // }
511
512 // @Override
513 // public void logDouble(double value, long timestamp) {
514 // Publisher pub = m_pub;
515 // if (pub == null) {
516 // synchronized (this) {
517 // if (m_closed) {
518 // return;
519 // }
520 // // double-check
521 // pub = m_pub;
522 // if (pub == null) {
523 // pub =
524 // m_inst
525 // .getDoubleTopic(m_path)
526 // .publishEx(
527 // NetworkTableType.DOUBLE.getValueStr(),
528 // m_properties,
529 // new PubSubOption.KeepDuplicates(m_keepDuplicates));
530 // m_pub = pub;
531 // }
532 // }
533 // }
534
535 // switch (pub) {
536 // case DoublePublisher e -> e.set(value, timestamp);
537 // default -> TelemetryRegistry.reportWarning(m_path, "type mismatch");
538 // }
539 // }
540
541 // @Override
542 // public void logString(String value, String typeString, long timestamp) {
543 // Publisher pub = m_pub;
544 // if (pub == null) {
545 // synchronized (this) {
546 // if (m_closed) {
547 // return;
548 // }
549 // // double-check
550 // pub = m_pub;
551 // if (pub == null) {
552 // m_typeString = typeString;
553 // pub =
554 // m_inst
555 // .getStringTopic(m_path)
556 // .publishEx(
557 // m_typeString,
558 // m_properties,
559 // new PubSubOption.KeepDuplicates(m_keepDuplicates));
560 // m_pub = pub;
561 // }
562 // }
563 // }
564
565 // String curTypeString = m_typeString;
566
567 // switch (pub) {
568 // case StringPublisher e when curTypeString.equals(typeString) -> e.set(value, timestamp);
569 // default -> TelemetryRegistry.reportWarning(m_path, "type mismatch");
570 // }
571 // }
572
573 // @Override
574 // public void logBooleanArray(boolean[] value, long timestamp) {
575 // Publisher pub = m_pub;
576 // if (pub == null) {
577 // synchronized (this) {
578 // if (m_closed) {
579 // return;
580 // }
581 // // double-check
582 // pub = m_pub;
583 // if (pub == null) {
584 // pub =
585 // m_inst
586 // .getBooleanArrayTopic(m_path)
587 // .publishEx(
588 // NetworkTableType.BOOLEAN_ARRAY.getValueStr(),
589 // m_properties,
590 // new PubSubOption.KeepDuplicates(m_keepDuplicates));
591 // m_pub = pub;
592 // }
593 // }
594 // }
595
596 // switch (pub) {
597 // case BooleanArrayPublisher e -> e.set(value, timestamp);
598 // default -> TelemetryRegistry.reportWarning(m_path, "type mismatch");
599 // }
600 // }
601
602 // @Override
603 // public void logShortArray(short[] value, long timestamp) {
604 // long[] arr = new long[value.length];
605 // for (int i = 0; i < value.length; i++) {
606 // arr[i] = value[i];
607 // }
608 // logLongArray(arr, timestamp);
609 // }
610
611 // @Override
612 // public void logIntArray(int[] value, long timestamp) {
613 // long[] arr = new long[value.length];
614 // for (int i = 0; i < value.length; i++) {
615 // arr[i] = value[i];
616 // }
617 // logLongArray(arr, timestamp);
618 // }
619
620 // @Override
621 // public void logLongArray(long[] value, long timestamp) {
622 // Publisher pub = m_pub;
623 // if (pub == null) {
624 // synchronized (this) {
625 // if (m_closed) {
626 // return;
627 // }
628 // // double-check
629 // pub = m_pub;
630 // if (pub == null) {
631 // pub =
632 // m_inst
633 // .getIntegerArrayTopic(m_path)
634 // .publishEx(
635 // NetworkTableType.INTEGER_ARRAY.getValueStr(),
636 // m_properties,
637 // new PubSubOption.KeepDuplicates(m_keepDuplicates));
638 // m_pub = pub;
639 // }
640 // }
641 // }
642
643 // switch (pub) {
644 // case IntegerArrayPublisher e -> e.set(value, timestamp);
645 // default -> TelemetryRegistry.reportWarning(m_path, "type mismatch");
646 // }
647 // }
648
649 // @Override
650 // public void logFloatArray(float[] value, long timestamp) {
651 // Publisher pub = m_pub;
652 // if (pub == null) {
653 // synchronized (this) {
654 // if (m_closed) {
655 // return;
656 // }
657 // // double-check
658 // pub = m_pub;
659 // if (pub == null) {
660 // pub =
661 // m_inst
662 // .getFloatArrayTopic(m_path)
663 // .publishEx(
664 // NetworkTableType.FLOAT_ARRAY.getValueStr(),
665 // m_properties,
666 // new PubSubOption.KeepDuplicates(m_keepDuplicates));
667 // m_pub = pub;
668 // }
669 // }
670 // }
671
672 // switch (pub) {
673 // case FloatArrayPublisher e -> e.set(value, timestamp);
674 // default -> TelemetryRegistry.reportWarning(m_path, "type mismatch");
675 // }
676 // }
677
678 // @Override
679 // public void logDoubleArray(double[] value, long timestamp) {
680 // Publisher pub = m_pub;
681 // if (pub == null) {
682 // synchronized (this) {
683 // if (m_closed) {
684 // return;
685 // }
686 // // double-check
687 // pub = m_pub;
688 // if (pub == null) {
689 // pub =
690 // m_inst
691 // .getDoubleArrayTopic(m_path)
692 // .publishEx(
693 // NetworkTableType.DOUBLE_ARRAY.getValueStr(),
694 // m_properties,
695 // new PubSubOption.KeepDuplicates(m_keepDuplicates));
696 // m_pub = pub;
697 // }
698 // }
699 // }
700
701 // switch (pub) {
702 // case DoubleArrayPublisher e -> e.set(value, timestamp);
703 // default -> TelemetryRegistry.reportWarning(m_path, "type mismatch");
704 // }
705 // }
706
707 // @Override
708 // public void logStringArray(String[] value, long timestamp) {
709 // Publisher pub = m_pub;
710 // if (pub == null) {
711 // synchronized (this) {
712 // if (m_closed) {
713 // return;
714 // }
715 // // double-check
716 // pub = m_pub;
717 // if (pub == null) {
718 // pub =
719 // m_inst
720 // .getStringArrayTopic(m_path)
721 // .publishEx(
722 // NetworkTableType.STRING_ARRAY.getValueStr(),
723 // m_properties,
724 // new PubSubOption.KeepDuplicates(m_keepDuplicates));
725 // m_pub = pub;
726 // }
727 // }
728 // }
729
730 // switch (pub) {
731 // case StringArrayPublisher e -> e.set(value, timestamp);
732 // default -> TelemetryRegistry.reportWarning(m_path, "type mismatch");
733 // }
734 // }
735
736 // @Override
737 // public void logRaw(byte[] value, String typeString, long timestamp) {
738 // Publisher pub = m_pub;
739 // if (pub == null) {
740 // synchronized (this) {
741 // if (m_closed) {
742 // return;
743 // }
744 // // double-check
745 // pub = m_pub;
746 // if (pub == null) {
747 // m_typeString = typeString;
748 // pub =
749 // m_inst
750 // .getRawTopic(m_path)
751 // .publishEx(
752 // m_typeString,
753 // m_properties,
754 // new PubSubOption.KeepDuplicates(m_keepDuplicates));
755 // m_pub = pub;
756 // }
757 // }
758 // }
759
760 // String curTypeString = m_typeString;
761
762 // switch (pub) {
763 // case RawPublisher e when curTypeString.equals(typeString) -> e.set(value, timestamp);
764 // default -> TelemetryRegistry.reportWarning(m_path, "type mismatch");
765 // }
766 // }
767 // }
768}