Class PropertiesBasedTcpOptionFactory
- java.lang.Object
-
- org.pcap4j.packet.factory.propertiesbased.PropertiesBasedTcpOptionFactory
-
- All Implemented Interfaces:
PacketFactory<TcpPacket.TcpOption,TcpOptionKind>
public final class PropertiesBasedTcpOptionFactory extends java.lang.Object implements PacketFactory<TcpPacket.TcpOption,TcpOptionKind>
- Since:
- pcap4j 0.9.14
-
-
Field Summary
Fields Modifier and Type Field Description private static PropertiesBasedTcpOptionFactoryINSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description privatePropertiesBasedTcpOptionFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PropertiesBasedTcpOptionFactorygetInstance()java.lang.Class<? extends TcpPacket.TcpOption>getTargetClass()java.lang.Class<? extends TcpPacket.TcpOption>getTargetClass(TcpOptionKind number)TcpPacket.TcpOptionnewInstance(byte[] rawData, int offset, int length)TcpPacket.TcpOptionnewInstance(byte[] rawData, int offset, int length, java.lang.Class<? extends TcpPacket.TcpOption> dataClass)TcpPacket.TcpOptionnewInstance(byte[] rawData, int offset, int length, TcpOptionKind number)
-
-
-
Field Detail
-
INSTANCE
private static final PropertiesBasedTcpOptionFactory INSTANCE
-
-
Method Detail
-
getInstance
public static PropertiesBasedTcpOptionFactory getInstance()
- Returns:
- the singleton instance of PropertiesBasedTcpOptionFactory.
-
newInstance
public TcpPacket.TcpOption newInstance(byte[] rawData, int offset, int length, TcpOptionKind number)
- Specified by:
newInstancein interfacePacketFactory<TcpPacket.TcpOption,TcpOptionKind>- Parameters:
rawData- rawDataoffset- offsetlength- lengthnumber- number- Returns:
- a new data object.
-
newInstance
public TcpPacket.TcpOption newInstance(byte[] rawData, int offset, int length)
- Specified by:
newInstancein interfacePacketFactory<TcpPacket.TcpOption,TcpOptionKind>- Parameters:
rawData- rawDataoffset- offsetlength- length- Returns:
- a new data object.
-
newInstance
public TcpPacket.TcpOption newInstance(byte[] rawData, int offset, int length, java.lang.Class<? extends TcpPacket.TcpOption> dataClass)
- Parameters:
rawData- rawDataoffset- offsetlength- lengthdataClass- dataClass- Returns:
- a new TcpOption object.
- Throws:
java.lang.IllegalStateException- if an access to the newInstance method of the dataClass fails.java.lang.IllegalArgumentException- if an exception other thanIllegalRawDataExceptionis thrown by newInstance method of the dataClass.java.lang.NullPointerException- if any of arguments are null.
-
getTargetClass
public java.lang.Class<? extends TcpPacket.TcpOption> getTargetClass(TcpOptionKind number)
- Specified by:
getTargetClassin interfacePacketFactory<TcpPacket.TcpOption,TcpOptionKind>- Parameters:
number- number- Returns:
- a
Classobject this factory instantiates byPacketFactory.newInstance(byte[], int, int, NamedNumber)with the number argument.
-
getTargetClass
public java.lang.Class<? extends TcpPacket.TcpOption> getTargetClass()
- Specified by:
getTargetClassin interfacePacketFactory<TcpPacket.TcpOption,TcpOptionKind>- Returns:
- a
Classobject this factory instantiates byPacketFactory.newInstance(byte[], int, int).
-
-