org.minidns.edns

## Class Edns

- java.lang.Object
- - org.minidns.edns.Edns

-     public class Edns
      extends Object

  EDNS - Extension Mechanism for DNS.
  See Also:
    RFC 6891 - Extension Mechanisms for DNS (EDNS(0))

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Edns.Builder` Builder for creating EDNS instances.
    `static class` | `Edns.OptionCode` The EDNS option code.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `boolean` | `dnssecOk` Whether DNSSEC OK flag is set.
    `int` | `extendedRcode` 8-bit extended return code.
    `static int` | `FLAG_DNSSEC_OK` Inform the dns server that the client supports DNSSEC.
    `int` | `flags` 16-bit flags.
    `int` | `udpPayloadSize` The UDP payload size.
    `List<EdnsOption>` | `variablePart` The list of EDNS options.
    `int` | `version` 8-bit version field.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Edns(Edns.Builder builder)` Creates an EDNS instance from a builder.
    `Edns(Record<OPT> optRecord)` Creates an EDNS instance from an OPT record.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Record<OPT>` | `asRecord()` Converts this EDNS instance to an OPT record.
    `String` | `asTerminalOutput()` Returns the terminal output representation of this EDNS instance.
    `static Edns.Builder` | `builder()` Creates a new builder for constructing EDNS instances.
    `static Edns` | `fromRecord(Record<? extends Data> record)` Creates an EDNS instance from a record if it's an OPT record.
    `<O extends EdnsOption> O` | `getEdnsOption(Edns.OptionCode optionCode)` Gets the EDNS option with the specified option code.
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### dnssecOk

          public final boolean dnssecOk

      Whether DNSSEC OK flag is set.

    - #### extendedRcode

          public final int extendedRcode

      8-bit extended return code. RFC 6891 § 6.1.3 EXTENDED-RCODE

    - #### FLAG_DNSSEC_OK

          public static final int FLAG_DNSSEC_OK

      Inform the dns server that the client supports DNSSEC.
      See Also:
        Constant Field Values

    - #### flags

          public final int flags

      16-bit flags. RFC 6891 § 6.1.4

    - #### udpPayloadSize

          public final int udpPayloadSize

      The UDP payload size.

    - #### variablePart

          public final List<EdnsOption> variablePart

      The list of EDNS options.

    - #### version

          public final int version

      8-bit version field. RFC 6891 § 6.1.3 VERSION

  - ### Constructor Detail

    - #### Edns

          public Edns(Edns.Builder builder)

      Creates an EDNS instance from a builder.
      Parameters:
        `builder` - the builder containing EDNS configuration

    - #### Edns

          public Edns(Record<OPT> optRecord)

      Creates an EDNS instance from an OPT record.
      Parameters:
        `optRecord` - the OPT record

  - ### Method Detail

    - #### asRecord

          public Record<OPT> asRecord()

      Converts this EDNS instance to an OPT record.
      Returns:
        the OPT record

    - #### asTerminalOutput

          public String asTerminalOutput()

      Returns the terminal output representation of this EDNS instance.
      Returns:
        the terminal output representation

    - #### builder

          public static Edns.Builder builder()

      Creates a new builder for constructing EDNS instances.
      Returns:
        a new builder

    - #### fromRecord

          public static Edns fromRecord(Record<? extends Data> record)

      Creates an EDNS instance from a record if it's an OPT record.
      Parameters:
        `record` - the record to convert
      Returns:
        the EDNS instance if the record is an OPT record, null otherwise

    - #### getEdnsOption

          public <O extends EdnsOption> O getEdnsOption(Edns.OptionCode optionCode)

      Gets the EDNS option with the specified option code.
      Type Parameters:
        `O` - the type of the EDNS option
      Parameters:
        `optionCode` - the option code to search for
      Returns:
        the EDNS option if found, null otherwise

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`