T - the type of the protocolpublic final class ProtocolDetectionResult<T>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static ProtocolDetectionResult |
INVALID |
private static ProtocolDetectionResult |
NEEDS_MORE_DATE |
private T |
result |
private ProtocolDetectionState |
state |
| Modifier | Constructor and Description |
|---|---|
private |
ProtocolDetectionResult(ProtocolDetectionState state,
T result) |
| Modifier and Type | Method and Description |
|---|---|
static <T> ProtocolDetectionResult<T> |
detected(T protocol)
Returns a
ProtocolDetectionResult which holds the detected protocol. |
T |
detectedProtocol()
|
static <T> ProtocolDetectionResult<T> |
invalid()
Returns a
ProtocolDetectionResult that signals the data was invalid for the protocol. |
static <T> ProtocolDetectionResult<T> |
needsMoreData()
Returns a
ProtocolDetectionResult that signals that more data is needed to detect the protocol. |
ProtocolDetectionState |
state()
Return the
ProtocolDetectionState. |
private static final ProtocolDetectionResult NEEDS_MORE_DATE
private static final ProtocolDetectionResult INVALID
private final ProtocolDetectionState state
private final T result
private ProtocolDetectionResult(ProtocolDetectionState state, T result)
public static <T> ProtocolDetectionResult<T> needsMoreData()
ProtocolDetectionResult that signals that more data is needed to detect the protocol.public static <T> ProtocolDetectionResult<T> invalid()
ProtocolDetectionResult that signals the data was invalid for the protocol.public static <T> ProtocolDetectionResult<T> detected(T protocol)
ProtocolDetectionResult which holds the detected protocol.public ProtocolDetectionState state()
ProtocolDetectionState. If the state is ProtocolDetectionState.DETECTED you
can retrieve the protocol via detectedProtocol().public T detectedProtocol()