EDNSOption (dnsjava documentation)
Date: 2013-04-10

org.xbill.DNS

## Class EDNSOption

- java.lang.Object
- - org.xbill.DNS.EDNSOption

- Direct Known Subclasses:
    ClientSubnetOption, GenericEDNSOption

      public abstract class EDNSOption
      extends Object

  DNS extension options, as described in RFC 2671. The rdata of an OPT record is defined as a list of options; this represents a single option.
  Author:
    Brian Wellington, Ming Zhou <mizhou@bnivideo.com>, Beaumaris Networks

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `EDNSOption.Code`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EDNSOption(int code)` Creates an option with the given option code and data.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object arg)` Determines if two EDNS Options are identical.
    `static EDNSOption` | `fromWire(byte[] b)` Converts the wire format of an EDNS Option (including code and length) into the type-specific format.
    `int` | `getCode()` Returns the EDNS Option's code.
    `int` | `hashCode()` Generates a hash code based on the EDNS Option's data.
    `String` | `toString()`
    `byte[]` | `toWire()` Converts an EDNS Option (including code and length) into wire format.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### EDNSOption

          public EDNSOption(int code)

      Creates an option with the given option code and data.

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getCode

          public int getCode()

      Returns the EDNS Option's code.
      Returns:
        the option code

    - #### fromWire

          public static EDNSOption fromWire(byte[] b)
                                     throws IOException

      Converts the wire format of an EDNS Option (including code and length) into the type-specific format.
      Returns:
        The option, in wire format.
      Throws:
        `IOException`

    - #### toWire

          public byte[] toWire()
                        throws IOException

      Converts an EDNS Option (including code and length) into wire format.
      Returns:
        The option, in wire format.
      Throws:
        `IOException`

    - #### equals

          public boolean equals(Object arg)

      Determines if two EDNS Options are identical.
      Overrides:
        `equals` in class `Object`
      Parameters:
        `arg` - The option to compare to
      Returns:
        true if the options are equal, false otherwise.

    - #### hashCode

          public int hashCode()

      Generates a hash code based on the EDNS Option's data.
      Overrides:
        `hashCode` in class `Object`