2 * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.mdsal.replicate.netty;
10 import static java.util.Objects.requireNonNull;
12 import io.netty.channel.ChannelHandlerContext;
13 import io.netty.handler.codec.MessageToMessageEncoder;
14 import java.io.IOException;
15 import java.util.List;
16 import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeStreamVersion;
18 final class DeltaEncoder extends MessageToMessageEncoder<AbstractSourceMessage> {
19 private final NormalizedNodeStreamVersion version;
21 DeltaEncoder(final NormalizedNodeStreamVersion version) {
22 this.version = requireNonNull(version);
26 protected void encode(final ChannelHandlerContext ctx, final AbstractSourceMessage msg, final List<Object> out)
28 msg.encodeTo(version, out);