Package yapion.packet
Class YAPIONPacket
- java.lang.Object
-
- yapion.packet.YAPIONPacket
-
- Direct Known Subclasses:
DeserializationExceptionPacket
,DropPacket
,HandleFailedPacket
,HeartBeatPacket
,LostHeartBeatPacket
public abstract class YAPIONPacket extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description YAPIONPacket()
-
Method Summary
Modifier and Type Method Description java.lang.Exception
getException()
The exception that was thrown by theYAPIONPacketHandler.handlePacket(YAPIONPacket)
method.java.lang.String
getType()
The type name returned byClass.getTypeName()
.YAPIONPacketStream
getYAPIONPacketStream()
void
setYAPIONPacketStream(YAPIONPacketStream yapionPacketStream)
Set theYAPIONOutputStream
that corresponds to theInputStream
.YAPIONObject
toYAPION()
Serialize thisYAPIONPacket
to aYAPIONObject
.
-
-
-
Method Detail
-
toYAPION
public final YAPIONObject toYAPION()
Serialize thisYAPIONPacket
to aYAPIONObject
.- Returns:
- a
YAPIONObject
-
getType
public final java.lang.String getType()
The type name returned byClass.getTypeName()
.- Returns:
- result of
Class.getTypeName()
-
getException
public final java.lang.Exception getException()
The exception that was thrown by theYAPIONPacketHandler.handlePacket(YAPIONPacket)
method. You could for example log thisException
in theYAPIONPacketHandler
set withYAPIONPacketReceiver.setHandler(YAPIONPacketReceiver.Handler, YAPIONPacketHandler)
, withYAPIONPacketReceiver.Handler.EXCEPTION
.- Returns:
- the
Exception
that was thrown
-
getYAPIONPacketStream
public final YAPIONPacketStream getYAPIONPacketStream()
- Returns:
- the
YAPIONOutputStream
set byYAPIONSocket
-
setYAPIONPacketStream
public final void setYAPIONPacketStream(YAPIONPacketStream yapionPacketStream)
Set theYAPIONOutputStream
that corresponds to theInputStream
. This normally gets called byYAPIONPacketStream
and will be set to theYAPIONOutputStream
by theYAPIONSocket
corresponding to this.- Parameters:
yapionPacketStream
- theYAPIONOutputStream
to set
-
-