/** * Formats an event and returns the formatted message. This method is currently only used for formatting * {@link ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)}. * * @param eventName the name of the event * @param firstArg the first argument of the event * @param secondArg the second argument of the event */ protected String format(ChannelHandlerContext ctx, String eventName, Object firstArg, Object secondArg) { if (secondArg == null) { return formatSimple(ctx, eventName, firstArg); } String chStr = ctx.channel().toString(); String arg1Str = String.valueOf(firstArg); String arg2Str = secondArg.toString(); StringBuilder buf = new StringBuilder( chStr.length() + 1 + eventName.length() + 2 + arg1Str.length() + 2 + arg2Str.length()); buf.append(chStr).append(' ').append(eventName).append(": ").append(arg1Str).append(", ").append(arg2Str); return buf.toString(); }
/** * Formats an event and returns the formatted message. This method is currently only used for formatting * {@link ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)}. * * @param eventName the name of the event * @param firstArg the first argument of the event * @param secondArg the second argument of the event */ protected String format(ChannelHandlerContext ctx, String eventName, Object firstArg, Object secondArg) { if (secondArg == null) { return formatSimple(ctx, eventName, firstArg); } String chStr = ctx.channel().toString(); String arg1Str = String.valueOf(firstArg); String arg2Str = secondArg.toString(); StringBuilder buf = new StringBuilder( chStr.length() + 1 + eventName.length() + 2 + arg1Str.length() + 2 + arg2Str.length()); buf.append(chStr).append(' ').append(eventName).append(": ").append(arg1Str).append(", ").append(arg2Str); return buf.toString(); }
/** * Formats an event and returns the formatted message. * * @param eventName the name of the event * @param arg the argument of the event */ protected String format(ChannelHandlerContext ctx, String eventName, Object arg) { if (arg instanceof ByteBuf) { return formatByteBuf(ctx, eventName, (ByteBuf) arg); } else if (arg instanceof ByteBufHolder) { return formatByteBufHolder(ctx, eventName, (ByteBufHolder) arg); } else { return formatSimple(ctx, eventName, arg); } }
/** * Formats an event and returns the formatted message. * * @param eventName the name of the event * @param arg the argument of the event */ protected String format(ChannelHandlerContext ctx, String eventName, Object arg) { if (arg instanceof ByteBuf) { return formatByteBuf(ctx, eventName, (ByteBuf) arg); } else if (arg instanceof ByteBufHolder) { return formatByteBufHolder(ctx, eventName, (ByteBufHolder) arg); } else { return formatSimple(ctx, eventName, arg); } }
/** * Formats an event and returns the formatted message. This method is currently only used for formatting * {@link ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)}. * * @param eventName the name of the event * @param firstArg the first argument of the event * @param secondArg the second argument of the event */ protected String format(ChannelHandlerContext ctx, String eventName, Object firstArg, Object secondArg) { if (secondArg == null) { return formatSimple(ctx, eventName, firstArg); } String chStr = ctx.channel().toString(); String arg1Str = String.valueOf(firstArg); String arg2Str = secondArg.toString(); StringBuilder buf = new StringBuilder( chStr.length() + 1 + eventName.length() + 2 + arg1Str.length() + 2 + arg2Str.length()); buf.append(chStr).append(' ').append(eventName).append(": ").append(arg1Str).append(", ").append(arg2Str); return buf.toString(); }
/** * Formats an event and returns the formatted message. * * @param eventName the name of the event * @param arg the argument of the event */ protected String format(ChannelHandlerContext ctx, String eventName, Object arg) { if (arg instanceof ByteBuf) { return formatByteBuf(ctx, eventName, (ByteBuf) arg); } else if (arg instanceof ByteBufHolder) { return formatByteBufHolder(ctx, eventName, (ByteBufHolder) arg); } else { return formatSimple(ctx, eventName, arg); } }
/** * Formats an event and returns the formatted message. This method is currently only used for formatting * {@link ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)}. * * @param eventName the name of the event * @param firstArg the first argument of the event * @param secondArg the second argument of the event */ protected String format(ChannelHandlerContext ctx, String eventName, Object firstArg, Object secondArg) { if (secondArg == null) { return formatSimple(ctx, eventName, firstArg); } String chStr = ctx.channel().toString(); String arg1Str = String.valueOf(firstArg); String arg2Str = secondArg.toString(); StringBuilder buf = new StringBuilder( chStr.length() + 1 + eventName.length() + 2 + arg1Str.length() + 2 + arg2Str.length()); buf.append(chStr).append(' ').append(eventName).append(": ").append(arg1Str).append(", ").append(arg2Str); return buf.toString(); }
/** * Formats an event and returns the formatted message. This method is currently only used for formatting * {@link ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)}. * * @param eventName the name of the event * @param firstArg the first argument of the event * @param secondArg the second argument of the event */ protected String format(ChannelHandlerContext ctx, String eventName, Object firstArg, Object secondArg) { if (secondArg == null) { return formatSimple(ctx, eventName, firstArg); } String chStr = ctx.channel().toString(); String arg1Str = String.valueOf(firstArg); String arg2Str = secondArg.toString(); StringBuilder buf = new StringBuilder( chStr.length() + 1 + eventName.length() + 2 + arg1Str.length() + 2 + arg2Str.length()); buf.append(chStr).append(' ').append(eventName).append(": ").append(arg1Str).append(", ").append(arg2Str); return buf.toString(); }
/** * Formats an event and returns the formatted message. This method is currently only used for formatting * {@link ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)}. * * @param eventName the name of the event * @param firstArg the first argument of the event * @param secondArg the second argument of the event */ protected String format(ChannelHandlerContext ctx, String eventName, Object firstArg, Object secondArg) { if (secondArg == null) { return formatSimple(ctx, eventName, firstArg); } String chStr = ctx.channel().toString(); String arg1Str = String.valueOf(firstArg); String arg2Str = secondArg.toString(); StringBuilder buf = new StringBuilder( chStr.length() + 1 + eventName.length() + 2 + arg1Str.length() + 2 + arg2Str.length()); buf.append(chStr).append(' ').append(eventName).append(": ").append(arg1Str).append(", ").append(arg2Str); return buf.toString(); }
/** * Formats an event and returns the formatted message. * * @param eventName the name of the event * @param arg the argument of the event */ protected String format(ChannelHandlerContext ctx, String eventName, Object arg) { if (arg instanceof ByteBuf) { return formatByteBuf(ctx, eventName, (ByteBuf) arg); } else if (arg instanceof ByteBufHolder) { return formatByteBufHolder(ctx, eventName, (ByteBufHolder) arg); } else { return formatSimple(ctx, eventName, arg); } }
/** * Formats an event and returns the formatted message. * * @param eventName the name of the event * @param arg the argument of the event */ protected String format(ChannelHandlerContext ctx, String eventName, Object arg) { if (arg instanceof ByteBuf) { return formatByteBuf(ctx, eventName, (ByteBuf) arg); } else if (arg instanceof ByteBufHolder) { return formatByteBufHolder(ctx, eventName, (ByteBufHolder) arg); } else { return formatSimple(ctx, eventName, arg); } }
/** * Formats an event and returns the formatted message. * * @param eventName the name of the event * @param arg the argument of the event */ protected String format(ChannelHandlerContext ctx, String eventName, Object arg) { if (arg instanceof ByteBuf) { return formatByteBuf(ctx, eventName, (ByteBuf) arg); } else if (arg instanceof ByteBufHolder) { return formatByteBufHolder(ctx, eventName, (ByteBufHolder) arg); } else { return formatSimple(ctx, eventName, arg); } }