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.ObjectResult of detecting a protocol.
-
-
Field Summary
Fields Modifier and Type Field Description private static ProtocolDetectionResultINVALIDprivate static ProtocolDetectionResultNEEDS_MORE_DATAprivate Tresultprivate ProtocolDetectionStatestate
-
Constructor Summary
Constructors Modifier Constructor Description privateProtocolDetectionResult(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 aProtocolDetectionResultwhich holds the detected protocol.TdetectedProtocol()static <T> ProtocolDetectionResult<T>invalid()Returns aProtocolDetectionResultthat signals the data was invalid for the protocol.static <T> ProtocolDetectionResult<T>needsMoreData()Returns aProtocolDetectionResultthat signals that more data is needed to detect the protocol.ProtocolDetectionStatestate()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 aProtocolDetectionResultthat signals that more data is needed to detect the protocol.
-
invalid
public static <T> ProtocolDetectionResult<T> invalid()
Returns aProtocolDetectionResultthat signals the data was invalid for the protocol.
-
detected
public static <T> ProtocolDetectionResult<T> detected(T protocol)
Returns aProtocolDetectionResultwhich holds the detected protocol.
-
state
public ProtocolDetectionState state()
Return theProtocolDetectionState. If the state isProtocolDetectionState.DETECTEDyou can retrieve the protocol viadetectedProtocol().
-
detectedProtocol
public T detectedProtocol()
-
-