Package yapion.packet
Class YAPIONPacket
- java.lang.Object
-
- yapion.packet.YAPIONPacket
-
- Direct Known Subclasses:
DeserializationExceptionPacket
,DropPacket
,HandleFailedPacket
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()
.YAPIONOutputStream
getYAPIONOutputStream()
void
setYAPIONOutputStream(YAPIONOutputStream yapionOutputStream)
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.setErrorHandler(YAPIONPacketHandler)
.- Returns:
- the
Exception
that was thrown
-
getYAPIONOutputStream
public final YAPIONOutputStream getYAPIONOutputStream()
- Returns:
- the
YAPIONOutputStream
set byYAPIONSocket
-
setYAPIONOutputStream
public final void setYAPIONOutputStream(YAPIONOutputStream yapionOutputStream)
Set theYAPIONOutputStream
that corresponds to theInputStream
. This normally gets called byYAPIONInputStream
and will be set to theYAPIONOutputStream
by theYAPIONSocket
corresponding to this.- Parameters:
yapionOutputStream
- theYAPIONOutputStream
to set
-
-