public abstract class OpenflowStructure extends Object implements Structure
| Modifier and Type | Field and Description |
|---|---|
protected ProtocolVersion |
version
Every structure knows what version it is representing.
|
| Constructor and Description |
|---|
OpenflowStructure(ProtocolVersion pv)
Constructs an OpenFlow structure.
|
| Modifier and Type | Method and Description |
|---|---|
ProtocolVersion |
getVersion()
Returns the protocol version of this OpenFlow structure.
|
protected static String |
hex(int value)
Returns the given int as a string in hex form.
|
protected static String |
hex(long value)
Returns the given long as a string in hex form.
|
String |
toDebugString()
Returns a string representation useful for debugging.
|
String |
toString() |
void |
validate()
Validates this structure for completeness and throws an exception
if the structure is considered "not complete".
|
protected final ProtocolVersion version
public OpenflowStructure(ProtocolVersion pv)
pv - the protocol versionpublic ProtocolVersion getVersion()
StructuregetVersion in interface Structurepublic String toDebugString()
toString(), but
subclasses are free to override this behavior.toDebugString in interface Structurepublic void validate()
throws IncompleteStructureException
This default implementation does nothing, i.e. default behavior is that structures are considered complete.
Subclasses should override this method to check that mandatory fields or other internal state is present, throwing an exception if it is not.
IncompleteStructureException - if the structure is not completeprotected static String hex(long value)
value - the valueprotected static String hex(int value)
value - the valueCopyright © 2014. All Rights Reserved.