broken.java

来自「用Java实现的23个常用设计模式源代码」· Java 代码 · 共 49 行

JAVA
49
字号
//$Id: Broken.java,v 1.1.2.1 2003/11/08 02:25:29 oneovthafew Exp $
package org.hibernate.test;

import java.io.Serializable;
import java.util.Date;

/**
 * @author Gavin King
 */
public class Broken implements Serializable {
	private Long id;
	private String otherId;
	private Date timestamp;
	public Long getId() {
		return id;
	}

	public Date getTimestamp() {
		return timestamp;
	}

	public void setId(Long long1) {
		id = long1;
	}

	public void setTimestamp(Date date) {
		timestamp = date;
	}

	public String getOtherId() {
		return otherId;
	}

	public void setOtherId(String string) {
		otherId = string;
	}
	
	public boolean equals(Object other) {
		if ( !(other instanceof Broken) ) return false;
		Broken that = (Broken) other;
		return this.id.equals(that.id) && this.otherId.equals(that.otherId);
	}
	
	public int hashCode() {
		return 1;
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?