java.lang.Object
java.lang.Enum<Edns.OptionCode>
org.minidns.edns.Edns.OptionCode
All Implemented Interfaces:
Serializable, Comparable<Edns.OptionCode>, java.lang.constant.Constable
Enclosing class:
Edns

public static enum Edns.OptionCodeextends Enum<Edns.OptionCode>
The EDNS option code.
See Also:
  • Enum Constant Details

  • Field Details

    • INVERSE_LUT

      private static Map<Integer, Edns.OptionCode> INVERSE_LUT
      The option codes, by number.
    • asInt

      public final int asInt
      Numeric EDNS option code carried on the wire.
    • clazz

      public final Class<? extends EdnsOption> clazz
      Option class registered for that code, or null for an unknown one.
  • Constructor Details

    • OptionCode

      private OptionCode(int optionCode, Class<? extends EdnsOption> clazz)
      Names one option type.
      Parameters:
      optionCode - the number of the option
      clazz - the class of the option
  • Method Details

    • values

      public static Edns.OptionCode[] 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 Edns.OptionCode 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
    • from

      public static Edns.OptionCode from(int optionCode)
      Looks up the registered option for a numeric EDNS option code.
      Parameters:
      optionCode - the numeric EDNS option code to look up
      Returns:
      the matching OptionCode, or UNKNOWN if no option is registered for that code