- java.lang.Object
-
- java.lang.Enum<BufferConversionHandler.Conversion>
-
- io.netty5.handler.adaptor.BufferConversionHandler.Conversion
-
- All Implemented Interfaces:
Serializable
,Comparable<BufferConversionHandler.Conversion>
- Enclosing class:
- BufferConversionHandler
public static enum BufferConversionHandler.Conversion extends Enum<BufferConversionHandler.Conversion>
The particular conversion operation to apply. See the individual operations for their specific behaviour.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BOTH
Convert anyBuffer
s intoByteBuf
s, and anyByteBuf
s intoBuffer
s.BUFFER_TO_BYTEBUF
ConvertBuffer
instances toByteBuf
instances.BYTEBUF_TO_BUFFER
ConvertByteBuf
instances toBuffer
instances.NONE
Do not convert anything, but let the messages pass through unchanged.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Object
convert(Object msg)
Apply this conversion to the given message, if applicable.abstract BufferConversionHandler.Conversion
invert()
Return aBufferConversionHandler.Conversion
that is the inverse of this one.static BufferConversionHandler.Conversion
valueOf(String name)
Returns the enum constant of this type with the specified name.static BufferConversionHandler.Conversion[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BYTEBUF_TO_BUFFER
public static final BufferConversionHandler.Conversion BYTEBUF_TO_BUFFER
ConvertByteBuf
instances toBuffer
instances.Messages that are either already of a
Buffer
type, or of an unknown type, will pass through unchanged.
-
BUFFER_TO_BYTEBUF
public static final BufferConversionHandler.Conversion BUFFER_TO_BYTEBUF
ConvertBuffer
instances toByteBuf
instances.Messages that are either already of a
ByteBuf
type, or of an unknown type, will pass through unchanged.
-
BOTH
public static final BufferConversionHandler.Conversion BOTH
Convert anyBuffer
s intoByteBuf
s, and anyByteBuf
s intoBuffer
s.Messages of unknown types are passed through unchanged.
-
NONE
public static final BufferConversionHandler.Conversion NONE
Do not convert anything, but let the messages pass through unchanged.
-
-
Method Detail
-
values
public static BufferConversionHandler.Conversion[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (BufferConversionHandler.Conversion c : BufferConversionHandler.Conversion.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static BufferConversionHandler.Conversion valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
convert
public abstract Object convert(Object msg)
Apply this conversion to the given message, if applicable.- Parameters:
msg
- The message to maybe be converted.- Returns:
- The result of the conversion.
-
invert
public abstract BufferConversionHandler.Conversion invert()
Return aBufferConversionHandler.Conversion
that is the inverse of this one.- Returns:
- A conversion that converts buffers in the opposite direction.
-
-