package edu.govschool.govchat.net;

/**
 * Class to represent a GovChat server.
 * There are two pieces of information needed for a client to connect to a
 * GovChat server, the hostname and port. While we could use a data structure
 * such as a <code>Map</code> to represent this, creating a custom class allows
 * us full control over how we want to represent a server in GovChat.
 * @author Mr. Davis
 */
public class GCServerInfo 
{
    // A nickname for the server
    private String nickname;
    // The hostname of the server, either as a DNS address or IP
    private String hostname;
    // The port to bind to
    private int port;
    
    /**
     * Empty constructor.
     * Creates a new <code>GCServerInfo</code> with empty information. The port
     * is stored as <code>java.lang.Integer.MAX_VALUE</code>.
     */
    public GCServerInfo()
    {
        this("", "", Integer.MAX_VALUE);
    }
    
    /**
     * Convenience constructor.
     * Creates a new <code>GCServerInfo</code> with the given hostname and port
     * but without a nickname
     * @param hostname the hostname to connect to
     * @param port the port to bind to
     */
    public GCServerInfo(String hostname, int port)
    {
        this("", hostname, port);
    }
    
    /**
     * Default constructor.
     * Creates a new <code>GCServerInfo</code> with the given nickname,
     * hostname, and port.
     * @param nickname the nickname for the server
     * @param hostname the hostname to connect to
     * @param port the port to bind to
     */
    public GCServerInfo(String nickname, String hostname, int port)
    {
        this.nickname = nickname;
        this.hostname = hostname;
        this.port = port;
    }
}
@@ -1714,9 +1714,1325 @@
 ;%0A    %7D%0A
+    %0A    /**%0A     * Sets the nickname for the %3Ccode%3EGCServerInfo%3C/code%3E.%0A     * We may want to update the nickname for a server.%0A     * @param nickname the new nickname%0A     */%0A    public void setNickname(String nickname)%0A    %7B%0A        this.nickname = nickname;%0A    %7D%0A%0A    /**%0A     * Sets the hostname for the %3Ccode%3EGCServerInfo%3C/code%3E.%0A     * The server details may change for a server.%0A     * @param hostname the new hostname%0A     */%0A    public void setHostname(String hostname)%0A    %7B%0A        this.hostname = hostname;%0A    %7D%0A    %0A    /**%0A     * Sets the port for the %3Ccode%3EGCServerInfo%3C/code%3E.%0A     * The server details may change for a server.%0A     * @param port the new port%0A     */%0A    public void setPort(int port)%0A    %7B%0A        this.port = port;%0A    %7D%0A    %0A    /**%0A     * Gets the nickname from the %3Ccode%3EGCServerInfo%3C/code%3E.%0A     * @return the current nickname%0A     */%0A    public String getNickname()%0A    %7B%0A        return this.nickname;%0A    %7D%0A    %0A    /**%0A     * Gets the hostname from the %3Ccode%3EGCServerInfo%3C/code%3E.%0A     * @return the current hostname%0A     */%0A    public String getHostname()%0A    %7B%0A        return this.hostname;%0A    %7D%0A    %0A    /**%0A     * Gets the port from the %3Ccode%3EGCServerInfo%3C/code%3E.%0A     * @return the current port%0A     */%0A    public int getPort()%0A    %7B%0A        return this.port;%0A    %7D%0A
 %7D

Add getters and setters for GCServerInfo's properties