package data.system;

import java.io.Serializable;

/**
 * An object containing location information regarding a system node
 * @author Balazs Pete
 *
 */
public class NodeInfo implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7378201805278309534L;
	private String name, location;
	
	/**
	 * Create a instance of {@link NodeInfo}
	 * @param name The name of the node
	 */
	public NodeInfo(String name) {
		this(name, null);
	}
	
	/**
	 * Create a instance of {@link NodeInfo}
	 * @param name The name of the node
	 * @param location The location (URI or IP address) of the node
	 */
	public NodeInfo(String name, String location) {
		this.name = name;
		this.location = location;
	}
	
	/**
	 * Get the name of the node
	 * @return The name of the node
	 */
	public String getName() {
		return name;
	}
	
	/**
	 * Add a location for a node 
	 * @param location A URI or IP address
	 */
	public void addLocation(String location) {
		this.location = location;
	}
	
	/**
	 * Get a location associated with the node
	 * @return A location (URI or IP address)
	 */
	public String getLocation() {
		return location;
	}
	
	public boolean equals(NodeInfo other) {
		if (other == null) return false;
		return location.equalsIgnoreCase(other.getLocation());
	}
}

@@ -1281,10 +1281,87 @@
 ());%0A%09%7D%0A
+%09%0A%09public String toString() %7B%0A%09%09return %22%3C%22 + name + %22%7C%22 + location + %22%3E%22;%0A%09%7D%0A
 %7D%0A

Add NodeInfo toString()