Class LocalAddress
java.lang.Object
java.net.SocketAddress
io.netty.channel.local.LocalAddress
- All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<LocalAddress>
public final class LocalAddress
extends java.net.SocketAddress
implements java.lang.Comparable<LocalAddress>
An endpoint in the local transport. Each endpoint is identified by a unique
case-insensitive string.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LocalAddressprivate final java.lang.Stringprivate static final longprivate final java.lang.String -
Constructor Summary
ConstructorsConstructorDescriptionLocalAddress(Channel channel) Creates a new ephemeral port based on the ID of the specified channel.LocalAddress(java.lang.Class<?> cls) Creates a new instance with a random ID based on the given class.LocalAddress(java.lang.String id) Creates a new instance with the specified ID. -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
ANY
-
id
private final java.lang.String id -
strVal
private final java.lang.String strVal
-
-
Constructor Details
-
LocalAddress
LocalAddress(Channel channel) Creates a new ephemeral port based on the ID of the specified channel. Note that we prepend an upper-case character so that it never conflicts with the addresses created by a user, which are always lower-cased on construction time. -
LocalAddress
public LocalAddress(java.lang.String id) Creates a new instance with the specified ID. -
LocalAddress
public LocalAddress(java.lang.Class<?> cls) Creates a new instance with a random ID based on the given class.
-
-
Method Details
-
id
public java.lang.String id()Returns the ID of this address. -
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o) - Overrides:
equalsin classjava.lang.Object
-
compareTo
- Specified by:
compareToin interfacejava.lang.Comparable<LocalAddress>
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-