contact.java
来自「Java的框架」· Java 代码 · 共 271 行
JAVA
271 行
package mcaps.apps.prrm.roaddefect.model;
import java.util.Date;
import mcap.core.base.model.BaseTimeObject;
import org.apache.commons.lang.builder.CompareToBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
/**
* The <code>Contact</code> represents the contact of a road defect.
* @author jov
* @date 30-Aug-2005
* @version 1.0.1.0
*/
public class Contact extends BaseTimeObject implements Comparable {
private static final long serialVersionUID = 799778284760195727L;
private String firstName;
private String lastName;
private String block;
private int floor;
private int unit;
private String roadName;
private String postcode;
private String country;
private String telephone;
private String email;
/**
* Returns the block.
* @return String
*/
public String getBlock () {
return block;
}
/**
* Sets the block.
* @param block The block to set.
*/
public void setBlock (String block) {
this.block = block;
}
/**
* Returns the country.
* @return String
*/
public String getCountry () {
return country;
}
/**
* Sets the country.
* @param country The country to set.
*/
public void setCountry (String country) {
this.country = country;
}
/**
* Returns the email.
* @return String
*/
public String getEmail () {
return email;
}
/**
* Sets the email.
* @param email The email to set.
*/
public void setEmail (String email) {
this.email = email;
}
/**
* Returns the firstName.
* @return String
*/
public String getFirstName () {
return firstName;
}
/**
* Sets the firstName.
* @param firstName The firstName to set.
*/
public void setFirstName (String firstName) {
this.firstName = firstName;
}
/**
* Returns the floor.
* @return int
*/
public int getFloor () {
return floor;
}
/**
* Sets the floor.
* @param floor The floor to set.
*/
public void setFloor (int floor) {
this.floor = floor;
}
/**
* Returns the lastModifiedTime.
* @return Date
*/
public Date getLastModifiedTime () {
return lastModifiedTime;
}
/**
* Sets the lastModifiedTime.
* @param lastModifiedTime The lastModifiedTime to set.
*/
public void setLastModifiedTime (Date lastModifiedTime) {
this.lastModifiedTime = lastModifiedTime;
}
/**
* Returns the lastName.
* @return String
*/
public String getLastName () {
return lastName;
}
/**
* Sets the lastName.
* @param lastName The lastName to set.
*/
public void setLastName (String lastName) {
this.lastName = lastName;
}
/**
* Returns the postcode.
* @return String
*/
public String getPostcode () {
return postcode;
}
/**
* Sets the postcode.
* @param postcode The postcode to set.
*/
public void setPostcode (String postcode) {
this.postcode = postcode;
}
/**
* Returns the roadName.
* @return String
*/
public String getRoadName () {
return roadName;
}
/**
* Sets the roadName.
* @param roadName The roadName to set.
*/
public void setRoadName (String roadName) {
this.roadName = roadName;
}
/**
* Returns the telephone.
* @return String
*/
public String getTelephone () {
return telephone;
}
/**
* Sets the telephone.
* @param telephone The telephone to set.
*/
public void setTelephone (String telephone) {
this.telephone = telephone;
}
/**
* Returns the unit.
* @return int
*/
public int getUnit () {
return unit;
}
/**
* Sets the unit.
* @param unit The unit to set.
*/
public void setUnit (int unit) {
this.unit = unit;
}
/**
* @see java.lang.Comparable#compareTo(Object)
*/
public int compareTo(Object object) {
Contact myClass = (Contact) object;
return new CompareToBuilder().append(this.creationTime,
myClass.creationTime).append(this.roadName, myClass.roadName)
.append(this.unit, myClass.unit).append(this.telephone,
myClass.telephone).append(this.floor, myClass.floor)
.append(this.firstName, myClass.firstName).append(this.block,
myClass.block).append(this.id, myClass.id).append(
this.lastName, myClass.lastName).append(this.country,
myClass.country)
.append(this.postcode, myClass.postcode).append(this.email,
myClass.email).append(this.lastModifiedTime,
myClass.lastModifiedTime).toComparison();
}
/**
* @see java.lang.Object#toString()
*/
public String toString() {
return new ToStringBuilder(this).append("id", this.id).append(
"country", this.country).append("postcode", this.postcode)
.append("floor", this.floor)
.append("telephone", this.telephone).append("lastModifiedTime",
this.lastModifiedTime).append("unit", this.unit)
.append("creationTime", this.creationTime).append("firstName",
this.firstName).append("lastName", this.lastName)
.append("roadName", this.roadName).append("email", this.email)
.append("block", this.block).toString();
}
/**
* @see java.lang.Object#equals(Object)
*/
public boolean equals(Object object) {
if (!(object instanceof Contact)) {
return false;
}
Contact rhs = (Contact) object;
return new EqualsBuilder().append(
this.creationTime, rhs.creationTime).append(this.roadName,
rhs.roadName).append(this.unit, rhs.unit).append(
this.telephone, rhs.telephone).append(this.floor, rhs.floor)
.append(this.firstName, rhs.firstName).append(this.block,
rhs.block).append(this.id, rhs.id).append(
this.lastName, rhs.lastName).append(this.country,
rhs.country).append(this.postcode, rhs.postcode)
.append(this.email, rhs.email).append(this.lastModifiedTime,
rhs.lastModifiedTime).isEquals();
}
/**
* @see java.lang.Object#hashCode()
*/
public int hashCode() {
return new HashCodeBuilder(121300691, 555906033).append(this.creationTime).append(
this.roadName).append(this.unit).append(this.telephone).append(
this.floor).append(this.firstName).append(this.block).append(
this.id).append(this.lastName).append(this.country).append(
this.postcode).append(this.email).append(this.lastModifiedTime)
.toHashCode();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?