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.ExceptiongetException()The exception that was thrown by theYAPIONPacketHandler.handlePacket(YAPIONPacket)method.java.lang.StringgetType()The type name returned byClass.getTypeName().YAPIONPacketStreamgetYAPIONPacketStream()voidsetYAPIONPacketStream(YAPIONPacketStream yapionPacketStream)Set theYAPIONOutputStreamthat corresponds to theInputStream.YAPIONObjecttoYAPION()Serialize thisYAPIONPacketto aYAPIONObject.
-
-
-
Method Detail
-
toYAPION
public final YAPIONObject toYAPION()
Serialize thisYAPIONPacketto 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 thisExceptionin theYAPIONPacketHandlerset withYAPIONPacketReceiver.setHandler(YAPIONPacketReceiver.Handler, YAPIONPacketHandler), withYAPIONPacketReceiver.Handler.EXCEPTION.- Returns:
- the
Exceptionthat was thrown
-
getYAPIONPacketStream
public final YAPIONPacketStream getYAPIONPacketStream()
- Returns:
- the
YAPIONOutputStreamset byYAPIONSocket
-
setYAPIONPacketStream
public final void setYAPIONPacketStream(YAPIONPacketStream yapionPacketStream)
Set theYAPIONOutputStreamthat corresponds to theInputStream. This normally gets called byYAPIONPacketStreamand will be set to theYAPIONOutputStreamby theYAPIONSocketcorresponding to this.- Parameters:
yapionPacketStream- theYAPIONOutputStreamto set
-
-