Move VoidEnum to util
This commit is contained in:
parent
dbd973d825
commit
251a18160c
@ -20,7 +20,7 @@ import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.handler.codec.ReplayingDecoder;
|
||||
import io.netty.handler.codec.TooLongFrameException;
|
||||
import io.netty.handler.codec.VoidEnum;
|
||||
import io.netty.util.VoidEnum;
|
||||
|
||||
/**
|
||||
* Decodes {@link ChannelBuffer}s into {@link WebSocketFrame}s.
|
||||
|
@ -30,9 +30,9 @@ public abstract class MessageToMessageDecoder<I, O> extends ChannelInboundHandle
|
||||
|
||||
O emsg = decode(ctx, msg);
|
||||
if (emsg == null) {
|
||||
throw new IllegalArgumentException(
|
||||
"decode() returned null. unsupported message type? " +
|
||||
msg.getClass().getName());
|
||||
// Decoder consumed a message but returned null.
|
||||
// Probably it needs more messages.
|
||||
continue;
|
||||
}
|
||||
|
||||
if (unfoldAndAdd(ctx, ctx.nextIn(), emsg)) {
|
||||
|
@ -26,6 +26,7 @@ import io.netty.channel.ChannelInboundHandlerAdapter;
|
||||
import io.netty.channel.ChannelInboundHandlerContext;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.util.Signal;
|
||||
import io.netty.util.VoidEnum;
|
||||
|
||||
/**
|
||||
* A specialized variation of {@link StreamToMessageDecoder} which enables implementation
|
||||
|
@ -19,7 +19,7 @@ import io.netty.buffer.ChannelBuffer;
|
||||
import io.netty.buffer.ChannelBufferIndexFinder;
|
||||
import io.netty.channel.ChannelInboundHandlerContext;
|
||||
import io.netty.handler.codec.ReplayingDecoder;
|
||||
import io.netty.handler.codec.VoidEnum;
|
||||
import io.netty.util.VoidEnum;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
@ -21,6 +21,7 @@ import io.netty.buffer.ChannelBufferIndexFinder;
|
||||
import io.netty.buffer.ChannelBuffers;
|
||||
import io.netty.channel.ChannelInboundHandlerContext;
|
||||
import io.netty.handler.codec.embedder.DecoderEmbedder;
|
||||
import io.netty.util.VoidEnum;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -13,12 +13,11 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package io.netty.handler.codec;
|
||||
package io.netty.util;
|
||||
|
||||
|
||||
/**
|
||||
* A placeholder {@link Enum} which could be specified as a type parameter of
|
||||
* {@link ReplayingDecoder} when a user wants to manage the decoder state or
|
||||
* there's no state to manage.
|
||||
* A place holder {@link Enum} which has no constant.
|
||||
*/
|
||||
public enum VoidEnum {
|
||||
// No state is defined.
|
Loading…
Reference in New Issue
Block a user