www.pudn.com > dataswap.rar > Field.java


package com.gemt.dataswap.config; 
 
import java.io.Serializable; 
 
public class Field implements Serializable { 
	 
	/** 
	 * 表字段名称和类型 
	 */ 
	private static final long serialVersionUID = 1981750384845493769L; 
	private String name; 
	private String type; 
	private String value; 
	 
	public Field() { 
		 
	} 
	public Field(String name, String type) { 
		this.name = name; 
		this.type = type; 
	} 
	public Field(String name, String type, String value) { 
		this.name = name; 
		this.type = type; 
		this.value = value; 
	} 
	 
	public String getValue() 
	{ 
		return value; 
	} 
	public void setValue(String value) 
	{ 
		this.value = value; 
	} 
	public String getName() { 
		return name; 
	} 
	public void setName(String name) { 
		this.name = name; 
	} 
	public String getType() { 
		return type; 
	} 
	public void setType(String type) { 
		this.type = type; 
	} 
	@Override 
	public int hashCode() 
	{ 
		final int PRIME = 31; 
		int result = super.hashCode(); 
		result = PRIME * result + ((name == null) ? 0 : name.hashCode()); 
		result = PRIME * result + ((type == null) ? 0 : type.hashCode()); 
		result = PRIME * result + ((value == null) ? 0 : value.hashCode()); 
		return result; 
	} 
	@Override 
	public boolean equals(Object obj) 
	{ 
		if (this == obj) 
			return true; 
		if (!super.equals(obj)) 
			return false; 
		if (getClass() != obj.getClass()) 
			return false; 
		final Field other = (Field) obj; 
		if (name == null) 
		{ 
			if (other.name != null) 
				return false; 
		} 
		else if (!name.equals(other.name)) 
			return false; 
		if (type == null) 
		{ 
			if (other.type != null) 
				return false; 
		} 
		else if (!type.equals(other.type)) 
			return false; 
		if (value == null) 
		{ 
			if (other.value != null) 
				return false; 
		} 
		else if (!value.equals(other.value)) 
			return false; 
		return true; 
	} 
	 
	public String toString() { 
		return "Field {name = " + name + "\n" 
					+ "type = " + type + " }"; 
	} 
	 
	 
}