net.i2p.router.transport.udp

## Class RemoteHostId

- java.lang.Object
- - net.i2p.router.transport.udp.RemoteHostId

-     final class RemoteHostId
      extends Object

  Unique ID for a peer - its IP + port, all bundled into a tidy obj. If the remote peer is not reachable through an IP+port, this contains the hash of their identity.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RemoteHostId(byte[] ip, int port)` direct
    `RemoteHostId(Hash peerHash)` indirect

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `byte[]` | `getIP()`
    `Hash` | `getPeerHash()`
    `int` | `getPort()`
    `int` | `hashCode()`
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### RemoteHostId

          public RemoteHostId(byte[] ip,
                              int port)

      direct

    - #### RemoteHostId

          public RemoteHostId(Hash peerHash)

      indirect

  - ### Method Detail

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### getIP

          public byte[] getIP()

      Returns:
        null if indirect

    - #### getPeerHash

          public Hash getPeerHash()

      Returns:
        null if direct

    - #### getPort

          public int getPort()

      Returns:
        0 if indirect

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`