Class ServerInfo

  • All Implemented Interfaces:
    java.lang.Comparable<ServerInfo>

    public final class ServerInfo
    extends java.lang.Object
    implements java.lang.Comparable<ServerInfo>
    ServerInfo represents a server that a player can connect to. This object is immutable and safe for concurrent access.
    • Constructor Summary

      Constructors 
      Constructor Description
      ServerInfo​(java.lang.String name, java.net.SocketAddress address)
      Creates a new ServerInfo object.
    • Constructor Detail

      • ServerInfo

        public ServerInfo​(java.lang.String name,
                          java.net.SocketAddress address)
        Creates a new ServerInfo object.
        Parameters:
        name - the name for the server
        address - the address of the server to connect to
    • Method Detail

      • getName

        public final java.lang.String getName()
      • getAddress

        public final java.net.SocketAddress getAddress()
      • toString

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

        public final boolean equals​(@Nullable java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • compareTo

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