Class 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
    • 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
      int compareTo​(LocalAddress o)  
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      java.lang.String id()
      Returns the ID of this address.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • 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:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • compareTo

        public int compareTo​(LocalAddress o)
        Specified by:
        compareTo in interface java.lang.Comparable<LocalAddress>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object