*/
package org.opendaylight.mdsal.binding.dom.adapter;
+import static com.google.common.base.Verify.verify;
import static com.google.common.base.Verify.verifyNotNull;
import static java.util.Objects.requireNonNull;
abstract Set<Absolute> getSupportedNotifications();
private Notification<?> deserialize(final DOMNotification notification) {
- if (notification instanceof LazySerializedDOMNotification) {
+ if (notification instanceof LazySerializedNotification) {
// TODO: This is a routed-back notification, for which we may end up losing event time here, but that is
// okay, for now at least.
- return ((LazySerializedDOMNotification) notification).getBindingData();
+ return ((LazySerializedNotification) notification).getBindingData();
}
- final CurrentAdapterSerializer serializer = adapterContext.currentSerializer();
- return notification instanceof DOMEvent
+ final var serializer = adapterContext.currentSerializer();
+ final var result = notification instanceof DOMEvent
? serializer.fromNormalizedNodeNotification(notification.getType(), notification.getBody(),
((DOMEvent) notification).getEventInstant())
: serializer.fromNormalizedNodeNotification(notification.getType(), notification.getBody());
+ verify(result instanceof Notification, "Unexpected codec result %s", result);
+ return (Notification<?>) result;
}
}