Class PropertiesBasedIpV4OptionFactory
- java.lang.Object
-
- org.pcap4j.packet.factory.propertiesbased.PropertiesBasedIpV4OptionFactory
-
- All Implemented Interfaces:
PacketFactory<IpV4Packet.IpV4Option,IpV4OptionType>
public final class PropertiesBasedIpV4OptionFactory extends java.lang.Object implements PacketFactory<IpV4Packet.IpV4Option,IpV4OptionType>
- Since:
- pcap4j 0.9.14
-
-
Field Summary
Fields Modifier and Type Field Description private static PropertiesBasedIpV4OptionFactoryINSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description privatePropertiesBasedIpV4OptionFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PropertiesBasedIpV4OptionFactorygetInstance()java.lang.Class<? extends IpV4Packet.IpV4Option>getTargetClass()java.lang.Class<? extends IpV4Packet.IpV4Option>getTargetClass(IpV4OptionType number)IpV4Packet.IpV4OptionnewInstance(byte[] rawData, int offset, int length)IpV4Packet.IpV4OptionnewInstance(byte[] rawData, int offset, int length, java.lang.Class<? extends IpV4Packet.IpV4Option> dataClass)IpV4Packet.IpV4OptionnewInstance(byte[] rawData, int offset, int length, IpV4OptionType number)
-
-
-
Field Detail
-
INSTANCE
private static final PropertiesBasedIpV4OptionFactory INSTANCE
-
-
Method Detail
-
getInstance
public static PropertiesBasedIpV4OptionFactory getInstance()
- Returns:
- the singleton instance of PropertiesBasedIpV4OptionFactory.
-
newInstance
public IpV4Packet.IpV4Option newInstance(byte[] rawData, int offset, int length, IpV4OptionType number)
- Specified by:
newInstancein interfacePacketFactory<IpV4Packet.IpV4Option,IpV4OptionType>- Parameters:
rawData- rawDataoffset- offsetlength- lengthnumber- number- Returns:
- a new data object.
-
newInstance
public IpV4Packet.IpV4Option newInstance(byte[] rawData, int offset, int length)
- Specified by:
newInstancein interfacePacketFactory<IpV4Packet.IpV4Option,IpV4OptionType>- Parameters:
rawData- rawDataoffset- offsetlength- length- Returns:
- a new data object.
-
newInstance
public IpV4Packet.IpV4Option newInstance(byte[] rawData, int offset, int length, java.lang.Class<? extends IpV4Packet.IpV4Option> dataClass)
- Parameters:
rawData- rawDataoffset- offsetlength- lengthdataClass- dataClass- Returns:
- a new IpV4Option 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 IpV4Packet.IpV4Option> getTargetClass(IpV4OptionType number)
- Specified by:
getTargetClassin interfacePacketFactory<IpV4Packet.IpV4Option,IpV4OptionType>- 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 IpV4Packet.IpV4Option> getTargetClass()
- Specified by:
getTargetClassin interfacePacketFactory<IpV4Packet.IpV4Option,IpV4OptionType>- Returns:
- a
Classobject this factory instantiates byPacketFactory.newInstance(byte[], int, int).
-
-