public class CALMNETPacketFactoryWithPacket extends CALMNETPacketFactory
IPacketFactory
for calmnet packets
with the ability to set the IPacket
of supporting packets.Constructor and Description |
---|
CALMNETPacketFactoryWithPacket(boolean preferStreamPackets,
PacketLoader loader)
Constructs a new Instance of CALMNETPacketFactoryWithPacket with if
IStreamedPacket s are preferred and the specified PacketLoader . |
CALMNETPacketFactoryWithPacket(boolean preferStreamPackets,
PacketLoader loader,
IPacketFactory factory)
Constructs a new Instance of CALMNETPacketFactoryWithPacket with if
IStreamedPacket s are preferred, the specified PacketLoader and the IPacketFactory . |
Modifier and Type | Method and Description |
---|---|
IPacket |
getPacket()
Gets the
IPacket in use (Could be the same instance). |
IPacket |
getPacket(PacketProtocolInformation information)
Constructs a
IPacket of the protocol specified by the passed PacketProtocolInformation instance. |
void |
setPacket(IPacket packet)
Sets the
IPacket in use. |
areStreamPacketsPreferred, getCipherFactory, getPacketFactory, getPacketLoader, setCipherFactory, setPacketFactory, setPacketLoader, setStreamPacketsPreferred
public CALMNETPacketFactoryWithPacket(boolean preferStreamPackets, PacketLoader loader)
IStreamedPacket
s are preferred and the specified PacketLoader
.preferStreamPackets
- If streamed packets are preferred for construction.loader
- The packet loader to use.java.lang.NullPointerException
- loader is null.public CALMNETPacketFactoryWithPacket(boolean preferStreamPackets, PacketLoader loader, IPacketFactory factory)
IStreamedPacket
s are preferred, the specified PacketLoader
and the IPacketFactory
.preferStreamPackets
- If streamed packets are preferred for construction.loader
- The packet loader to use.factory
- The packet factory to use or null (null signifies to use the same instance).java.lang.NullPointerException
- loader is null.public IPacket getPacket(PacketProtocolInformation information)
IPacket
of the protocol specified by the passed PacketProtocolInformation
instance.getPacket
in interface IPacketFactory
getPacket
in class CALMNETPacketFactory
information
- The protocol information to use.java.lang.NullPointerException
- The information is null.public IPacket getPacket()
IPacket
in use (Could be the same instance).