Class PropertiesBasedIpV4OptionFactory
java.lang.Object
org.pcap4j.packet.factory.propertiesbased.PropertiesBasedIpV4OptionFactory
- All Implemented Interfaces:
PacketFactory<IpV4Packet.IpV4Option, IpV4OptionType>
public final class PropertiesBasedIpV4OptionFactory
extends Object
implements PacketFactory<IpV4Packet.IpV4Option, IpV4OptionType>
- Since:
- pcap4j 0.9.14
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends IpV4Packet.IpV4Option> Class<? extends IpV4Packet.IpV4Option> getTargetClass(IpV4OptionType number) newInstance(byte[] rawData, int offset, int length) newInstance(byte[] rawData, int offset, int length, Class<? extends IpV4Packet.IpV4Option> dataClass) newInstance(byte[] rawData, int offset, int length, IpV4OptionType number)
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
PropertiesBasedIpV4OptionFactory
private PropertiesBasedIpV4OptionFactory()
-
-
Method Details
-
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
- 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, Class<? extends IpV4Packet.IpV4Option> dataClass) - Parameters:
rawData- rawDataoffset- offsetlength- lengthdataClass- dataClass- Returns:
- a new IpV4Option object.
- Throws:
IllegalStateException- if an access to the newInstance method of the dataClass fails.IllegalArgumentException- if an exception other thanIllegalRawDataExceptionis thrown by newInstance method of the dataClass.NullPointerException- if any of arguments are null.
-
getTargetClass
- 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
- Specified by:
getTargetClassin interfacePacketFactory<IpV4Packet.IpV4Option, IpV4OptionType>- Returns:
- a
Classobject this factory instantiates byPacketFactory.newInstance(byte[], int, int).
-