package com.dev.swms.server.model.base;

import java.util.Set;

import com.dev.energy.server.model.Entity;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

public class Town extends Entity {
	/**
	 * @Description：城市信息
	 * @author  dev
	 * @Date：2009-2-12
	 */
	private static final long serialVersionUID = 1L;
	private String code;//城市代码
	private String name;//城市名称
	private boolean disabled = false;//是否有效
	private String description;//描述
	private Set<TransSite> locations;//运输地
	
	public int hashCode() {
		return new HashCodeBuilder().append(code).toHashCode();
	}

	public boolean equals(final Object other) {
		if (!(other instanceof Town))
			return false;
		Town castOther = (Town) other;
		return new EqualsBuilder().append(code, castOther.code).isEquals();
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDescription() {
		return description;
	}

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

	public boolean isDisabled() {
		return disabled;
	}

	public void setDisabled(boolean disabled) {
		this.disabled = disabled;
	}

	public Set<TransSite> getLocations() {
		return locations;
	}

	public void setLocations(Set<TransSite> locations) {
		this.locations = locations;
	}

	public String getName() {
		return name;
	}

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