public final class DefaultInboundPacket extends java.lang.Object implements InboundPacket
Constructor and Description |
---|
DefaultInboundPacket(ConnectPoint receivedFrom,
Ethernet parsed,
java.nio.ByteBuffer unparsed)
Creates an immutable inbound packet.
|
DefaultInboundPacket(ConnectPoint receivedFrom,
Ethernet parsed,
java.nio.ByteBuffer unparsed,
java.util.Optional<java.lang.Long> cookie)
Creates an immutable inbound packet with cookie.
|
Modifier and Type | Method and Description |
---|---|
java.util.Optional<java.lang.Long> |
cookie()
Returns the cookie in the packet in message.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
Ethernet |
parsed()
Returns the parsed form of the packet.
|
ConnectPoint |
receivedFrom()
Returns the device and port from where the packet was received.
|
java.lang.String |
toString() |
java.nio.ByteBuffer |
unparsed()
Unparsed packet data.
|
public DefaultInboundPacket(ConnectPoint receivedFrom, Ethernet parsed, java.nio.ByteBuffer unparsed)
receivedFrom
- connection point where receivedparsed
- parsed ethernet frameunparsed
- unparsed raw bytespublic DefaultInboundPacket(ConnectPoint receivedFrom, Ethernet parsed, java.nio.ByteBuffer unparsed, java.util.Optional<java.lang.Long> cookie)
receivedFrom
- connection point where receivedparsed
- parsed ethernet frameunparsed
- unparsed raw bytescookie
- cookiepublic ConnectPoint receivedFrom()
InboundPacket
receivedFrom
in interface InboundPacket
public Ethernet parsed()
InboundPacket
parsed
in interface InboundPacket
public java.nio.ByteBuffer unparsed()
InboundPacket
unparsed
in interface InboundPacket
public java.util.Optional<java.lang.Long> cookie()
InboundPacket
cookie
in interface InboundPacket
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object