@Test public void testNoList() throws Exception { OFMessageEncoder encoder = new OFMessageEncoder(); MockOfMessage message = new MockOfMessage(); OFMessage returnedMessage = (OFMessage) encoder.encode(null, null, message); assertThat(message, is(returnedMessage)); }
@Override protected Object encode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception { if (!(msg instanceof List)) { return msg; } @SuppressWarnings("unchecked") List<OFMessage> msglist = (List<OFMessage>) msg; ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); for (OFMessage ofm : msglist) { if (ofm != null) { ofm.writeTo(buf); } } return buf; }
OFMessageEncoder extends OneToOneEncoder { @Override protected Object encode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception { if (!(msg instanceof List)) { return msg; } @SuppressWarnings("unchecked") List<OFMessage> msglist = (List<OFMessage>) msg; ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); for (OFMessage ofm : msglist) { if (ofm != null) { ofm.writeTo(buf); } } return buf; } }
OFMessageEncoder extends OneToOneEncoder { @Override protected Object encode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception { if (!(msg instanceof List)) { return msg; } @SuppressWarnings("unchecked") List<OFMessage> msglist = (List<OFMessage>) msg; ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); for (OFMessage ofm : msglist) { if (ofm != null) { ofm.writeTo(buf); } } return buf; }  }
OFMessageEncoder extends OneToOneEncoder { @Override protected Object encode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception { if (!(msg instanceof List)) { return msg; } @SuppressWarnings("unchecked") List<OFMessage> msglist = (List<OFMessage>) msg; ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); for (OFMessage ofm : msglist) { if (ofm != null) { ofm.writeTo(buf); } } return buf; }   }
OFMessageEncoder extends OneToOneEncoder { @Override protected Object encode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception { if (!(msg instanceof List)) { return msg; } @SuppressWarnings("unchecked") List<OFMessage> msglist = (List<OFMessage>) msg; ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); for (OFMessage ofm : msglist) { if (ofm != null) { ofm.writeTo(buf); } } return buf; }    }