Package io.netty.channel.local
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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static LocalAddressANYprivate java.lang.Stringidprivate static longserialVersionUIDprivate java.lang.StringstrVal
-
Constructor Summary
Constructors Constructor Description LocalAddress(Channel channel)Creates a new ephemeral port based on the ID of the specified channel.LocalAddress(java.lang.String id)Creates a new instance with the specified ID.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(LocalAddress o)booleanequals(java.lang.Object o)inthashCode()java.lang.Stringid()Returns the ID of this address.java.lang.StringtoString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
ANY
public static final LocalAddress ANY
-
id
private final java.lang.String id
-
strVal
private final java.lang.String strVal
-
-
Constructor Detail
-
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.
-
-
Method Detail
-
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
public int compareTo(LocalAddress o)
- Specified by:
compareToin interfacejava.lang.Comparable<LocalAddress>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-