Package io.netty.handler.codec
Class ProtocolDetectionResult<T>
- java.lang.Object
-
- io.netty.handler.codec.ProtocolDetectionResult<T>
-
- Type Parameters:
T
- the type of the protocol
public final class ProtocolDetectionResult<T> extends java.lang.Object
Result of detecting a protocol.
-
-
Field Summary
Fields Modifier and Type Field Description private static ProtocolDetectionResult
INVALID
private static ProtocolDetectionResult
NEEDS_MORE_DATA
private T
result
private ProtocolDetectionState
state
-
Constructor Summary
Constructors Modifier Constructor Description private
ProtocolDetectionResult(ProtocolDetectionState state, T result)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> ProtocolDetectionResult<T>
detected(T protocol)
Returns aProtocolDetectionResult
which holds the detected protocol.T
detectedProtocol()
static <T> ProtocolDetectionResult<T>
invalid()
Returns aProtocolDetectionResult
that signals the data was invalid for the protocol.static <T> ProtocolDetectionResult<T>
needsMoreData()
Returns aProtocolDetectionResult
that signals that more data is needed to detect the protocol.ProtocolDetectionState
state()
Return theProtocolDetectionState
.
-
-
-
Field Detail
-
NEEDS_MORE_DATA
private static final ProtocolDetectionResult NEEDS_MORE_DATA
-
INVALID
private static final ProtocolDetectionResult INVALID
-
state
private final ProtocolDetectionState state
-
result
private final T result
-
-
Constructor Detail
-
ProtocolDetectionResult
private ProtocolDetectionResult(ProtocolDetectionState state, T result)
-
-
Method Detail
-
needsMoreData
public static <T> ProtocolDetectionResult<T> needsMoreData()
Returns aProtocolDetectionResult
that signals that more data is needed to detect the protocol.
-
invalid
public static <T> ProtocolDetectionResult<T> invalid()
Returns aProtocolDetectionResult
that signals the data was invalid for the protocol.
-
detected
public static <T> ProtocolDetectionResult<T> detected(T protocol)
Returns aProtocolDetectionResult
which holds the detected protocol.
-
state
public ProtocolDetectionState state()
Return theProtocolDetectionState
. If the state isProtocolDetectionState.DETECTED
you can retrieve the protocol viadetectedProtocol()
.
-
detectedProtocol
public T detectedProtocol()
-
-