i2p.susi.dns

## Class AddressBean

- java.lang.Object
- - i2p.susi.dns.AddressBean

-     public class AddressBean
      extends Object

  Bean representing an I2P address entry with hostname and destination. Provides methods for handling I2P addresses and their properties.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) static boolean` | `haveIDN` available as of Java 6

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AddressBean(String name, byte[] destination)` Constructs an AddressBean with hostname and destination as byte array.
    `AddressBean(String name, Destination destination)` Constructs an AddressBean with hostname and destination object.
    `AddressBean(String name, String destination)` Constructs an AddressBean with hostname and base64 encoded destination.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getAdded()` Gets the date when this address was added.
    `String` | `getB32()` Gets the base32 hash address for this destination.
    `String` | `getB64()` Gets the base64 hash of the destination.
    `String` | `getCert()` Do this the easy way
    `String` | `getDestination()` Gets the destination as base64 encoded string.
    `String` | `getDisplayName()` The Unicode name, translated from Punycode
    `String` | `getEncType()` Do this the easy way
    `String` | `getModded()` Gets the date when this address was last modified.
    `String` | `getName()` The ASCII (Punycode) name
    `String` | `getNotes()` Gets the notes for this address entry, HTML escaped.
    `(package private) String` | `getProp(String p)` Gets a property value for this address entry.
    `String` | `getSigType()` Do this the easy way
    `String` | `getSource()` Gets the source URL or name for this address entry.
    `String` | `getSourceHostname()` Gets the source URL with hostname as display text for this address entry.
    `boolean` | `isIDN()` Is the ASCII name Punycode-encoded?
    `boolean` | `isValidated()` Checks if this address has been validated.
    `void` | `setProperties(Properties p)` Sets the properties for this address entry.
    `(package private) static String` | `toASCII(String host)` Ref: java.net.IDN and RFC 3490
    `static String` | `toUnicode(String host)` The Unicode name, translated from Punycode

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

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

- - ### Field Detail

    - #### haveIDN

          static final boolean haveIDN

      available as of Java 6

  - ### Constructor Detail

    - #### AddressBean

          public AddressBean(String name,
                             byte[] destination)

      Constructs an AddressBean with hostname and destination as byte array.
      Parameters:
        `name` - the hostname
        `destination` - the destination as byte array

    - #### AddressBean

          public AddressBean(String name,
                             Destination destination)

      Constructs an AddressBean with hostname and destination object.
      Parameters:
        `name` - the hostname
        `destination` - the destination object

    - #### AddressBean

          public AddressBean(String name,
                             String destination)

      Constructs an AddressBean with hostname and base64 encoded destination.
      Parameters:
        `name` - the hostname
        `destination` - the base64 encoded destination

  - ### Method Detail

    - #### getAdded

          public String getAdded()

      Gets the date when this address was added.
      Returns:
        the date when added

    - #### getB32

          public String getB32()

      Gets the base32 hash address for this destination.
      Returns:
        the base32 hash address

    - #### getB64

          public String getB64()

      Gets the base64 hash of the destination.
      Returns:
        the base64 hash

    - #### getCert

          public String getCert()

      Do this the easy way
      Returns:
        the certificate type as a string

    - #### getDestination

          public String getDestination()

      Gets the destination as base64 encoded string.
      Returns:
        the base64 encoded destination

    - #### getDisplayName

          public String getDisplayName()

      The Unicode name, translated from Punycode
      Returns:
        the original string on error

    - #### getEncType

          public String getEncType()

      Do this the easy way
      Returns:
        the encryption type as a string

    - #### getModded

          public String getModded()

      Gets the date when this address was last modified.
      Returns:
        the date when modified

    - #### getName

          public String getName()

      The ASCII (Punycode) name
      Returns:
        the hostname

    - #### getNotes

          public String getNotes()

      Gets the notes for this address entry, HTML escaped.
      Returns:
        the notes, HTML escaped

    - #### getProp

          String getProp(String p)

      Gets a property value for this address entry.
      Parameters:
        `p` - the property key
      Returns:
        non-null, "" if not found

    - #### getSigType

          public String getSigType()

      Do this the easy way
      Returns:
        the signature type as a string

    - #### getSource

          public String getSource()

      Gets the source URL or name for this address entry.
      Returns:
        the source URL or name

    - #### getSourceHostname

          public String getSourceHostname()

      Gets the source URL with hostname as display text for this address entry.
      Returns:
        the source URL with hostname as display text

    - #### isIDN

          public boolean isIDN()

      Is the ASCII name Punycode-encoded?
      Returns:
        true if the name is Punycode-encoded

    - #### isValidated

          public boolean isValidated()

      Checks if this address has been validated.
      Returns:
        true if validated

    - #### setProperties

          public void setProperties(Properties p)

      Sets the properties for this address entry.
      Parameters:
        `p` - the properties to set

    - #### toASCII

          static String toASCII(String host)
                         throws IllegalArgumentException

      Ref: java.net.IDN and RFC 3490
      Parameters:
        `host` - will be converted to lower case
      Returns:
        name converted to lower case and punycoded if necessary
      Throws:
        `IllegalArgumentException` - on various errors or if IDN is needed but not available

    - #### toUnicode

          public static String toUnicode(String host)

      The Unicode name, translated from Punycode
      Parameters:
        `host` - the hostname to convert
      Returns:
        the original string on error