Top Description Fields Constructors Methods
io.netty.handler.codec

public final Class ProtocolDetectionResult<T>

extends Object
Class Inheritance
Type Parameters
<T>
the type of the protocol
Static Imports
io.netty.util.internal.ObjectUtil.checkNotNull

Result of detecting a protocol.

Field Summary

Modifier and TypeField and Description
private static final ProtocolDetectionResult<T>
private static final ProtocolDetectionResult<T>
private final T
private final ProtocolDetectionState

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static <T> ProtocolDetectionResult<T>
detected(T protocol)

Returns a ProtocolDetectionResult which holds the detected protocol.

public T
detectedProtocol()

Returns the protocol if state() returns ProtocolDetectionState#DETECTED, otherwise null.

public static <T> ProtocolDetectionResult<T>
invalid()

Returns a ProtocolDetectionResult that signals the data was invalid for the protocol.

public static <T> ProtocolDetectionResult<T>
needsMoreData()

Returns a ProtocolDetectionResult that signals that more data is needed to detect the protocol.

public ProtocolDetectionState
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INVALIDback to summary
private static final ProtocolDetectionResult<T> INVALID
Annotations
@SuppressWarnings:rawtypes, unchecked
NEEDS_MORE_DATAback to summary
private static final ProtocolDetectionResult<T> NEEDS_MORE_DATA
Annotations
@SuppressWarnings:rawtypes, unchecked
resultback to summary
private final T result
stateback to summary
private final ProtocolDetectionState state

Constructor Detail

ProtocolDetectionResultback to summary
private ProtocolDetectionResult(ProtocolDetectionState state, T result)

Method Detail

detectedback to summary
public static <T> ProtocolDetectionResult<T> detected(T protocol)

Returns a ProtocolDetectionResult which holds the detected protocol.

Annotations
@SuppressWarnings:unchecked
detectedProtocolback to summary
public T detectedProtocol()

Returns the protocol if state() returns ProtocolDetectionState#DETECTED, otherwise null.

invalidback to summary
public static <T> ProtocolDetectionResult<T> invalid()

Returns a ProtocolDetectionResult that signals the data was invalid for the protocol.

Annotations
@SuppressWarnings:unchecked
needsMoreDataback to summary
public static <T> ProtocolDetectionResult<T> needsMoreData()

Returns a ProtocolDetectionResult that signals that more data is needed to detect the protocol.

Annotations
@SuppressWarnings:unchecked
stateback to summary
public ProtocolDetectionState state()

Return the ProtocolDetectionState. If the state is ProtocolDetectionState#DETECTED you can retrieve the protocol via detectedProtocol().