java.lang.Object
net.i2p.router.transport.TransportManager.Port
Enclosing class:
TransportManager

static class TransportManager.Portextends Object
Port configuration for transport protocols.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final String
    IP address string.
    final boolean
    True if IPv6.
    final int
    Port number.
    final String
    Transport style.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Port(String style, int port)
    IPv4 only.
    Port(String style, String host, int port)
    IPv6 only.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    boolean
    Whether this port equals the given object: same transport style, same port number and the same IP, comparing a null IP as equal only to null.
    int
    Hash code combining style, port, and IP.

    Methods inherited from class Object

    clone, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • style

      public final String style
      Transport style.
    • port

      public final int port
      Port number.
    • isIPv6

      public final boolean isIPv6
      True if IPv6.
    • ip

      public final String ip
      IP address string.
  • Constructor Details

    • Port

      public Port(String style, int port)
      IPv4 only.
      Parameters:
      style - the transport style the port is for, e.g. SSU or NTCP
      port - the configured port number
    • Port

      public Port(String style, String host, int port)
      IPv6 only.
      Parameters:
      style - the transport style the port is for, e.g. SSU or NTCP
      host - the IPv6 address literal the port is bound to
      port - the configured port number
  • Method Details

    • hashCode

      public int hashCode()
      Hash code combining style, port, and IP.
      Overrides:
      hashCode in class Object
      Returns:
      the XOR of the style hash, the port and the IP hash
    • equals

      public boolean equals(Object o)
      Whether this port equals the given object: same transport style, same port number and the same IP, comparing a null IP as equal only to null.
      Overrides:
      equals in class Object
      Parameters:
      o - the object to compare against, which must be a Port to match
      Returns:
      true if equal