Module org.jnetpcap

Enum Class PcapOption

java.lang.Object
java.lang.Enum<PcapOption>
org.jnetpcap.constant.PcapOption
All Implemented Interfaces:
Serializable, Comparable<PcapOption>, Constable, IntSupplier

public enum PcapOption extends Enum<PcapOption> implements IntSupplier
Options usable with Pcap.init(PcapOption) call.
  • Enum Constant Details

    • CHAR_ENC_LOCAL

      public static final PcapOption CHAR_ENC_LOCAL
      strings are in the local character encoding.
    • CHAR_ENC_UTF_8

      public static final PcapOption CHAR_ENC_UTF_8
      strings are in UTF-8.
  • Field Details

    • PCAP_CHAR_ENC_LOCAL

      public static final int PCAP_CHAR_ENC_LOCAL
      strings are in the local character encoding.
      See Also:
    • PCAP_CHAR_ENC_UTF_8

      public static final int PCAP_CHAR_ENC_UTF_8
      strings are in UTF-8.
      See Also:
  • Method Details

    • values

      public static PcapOption[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PcapOption valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • valueOf

      public static PcapOption valueOf(int option) throws IllegalArgumentException
      Converts an integer value into a PCAP option constant.
      Parameters:
      option - the PCAP option numerical constant
      Returns:
      the PCAP option enum constant
      Throws:
      IllegalArgumentException - thrown if not found
    • toEnum

      public static Optional<PcapOption> toEnum(int option)
      Converts an integer value into a PCAP option constant, if found.
      Parameters:
      option - the PCAP option numerical constant
      Returns:
      the PCAP option enum constant
    • getAsInt

      public int getAsInt()
      Pcap option integer value.
      Specified by:
      getAsInt in interface IntSupplier
      Returns:
      the pcap option as integer
      See Also: