package TO;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlRootElement;

/**
 * 
 * @author Marcos García Núñez (mgarcianun@uoc.edu)
 *
 */
@XmlRootElement(name = "PrimaryHealthCareCenter")
public class PrimaryHealthCareCenterTO implements Serializable {

	private static final long serialVersionUID = 1L;

	private String name;
	private String location;


	public PrimaryHealthCareCenterTO() {
		super();
	}

	public PrimaryHealthCareCenterTO(String name, String location) {
		this.name = name;
		this.location = location;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getLocation() {
		return location;
	}

	public void setLocation(String description) {
		this.location = description;
	}

    @Override
    public boolean equals(Object other) {
        return (other instanceof PrimaryHealthCareCenterTO) && (name != null)
            ? name.equals(((PrimaryHealthCareCenterTO) other).getName())
            : (other == this);
    }

    @Override
    public int hashCode() {
        return (name != null)
            ? (this.getClass().hashCode() + name.hashCode())
            : super.hashCode();
    }
    
	@Override
	public String toString() {
	    return String.format("%s[name=%s]", getClass().getSimpleName(), getName());
	}
}
