package org.opendaylight.protocol.bmp.impl;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandler.Sharable;
import io.netty.channel.ChannelHandlerContext;
private final BmpMessageRegistry registry;
public BmpMessageToByteEncoder(final BmpMessageRegistry registry) {
- this.registry = Preconditions.checkNotNull(registry);
+ this.registry = requireNonNull(registry);
}
@Override
- protected void encode(final ChannelHandlerContext ctx, final Notification message, final ByteBuf out) throws Exception {
+ protected void encode(final ChannelHandlerContext ctx, final Notification message, final ByteBuf out)
+ throws Exception {
LOG.trace("Encoding message: {}", message);
this.registry.serializeMessage(message, out);
LOG.debug("Message sent to output: {}", message);