package com.doctor.esper.event;

import java.util.UUID;

import com.alibaba.fastjson.JSON;

/**
 * @author doctor
 *
 * @time 2015年6月3日 下午4:37:08
 */
public class Person {
	private UUID id;
	private String name;
	private String firstName;
	private String sex;
	private int age;

	public Person(String name, String firstName, String sex, int age) {
		this.id = UUID.randomUUID();
		this.name = name;
		this.firstName = firstName;
		this.sex = sex;
		this.age = age;
	}

	public UUID getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public String getFirstName() {
		return firstName;
	}

	public String getSex() {
		return sex;
	}

	public int getAge() {
		return age;
	}

	@Override
	public String toString() {
		return JSON.toJSONString(this);
	}

}

@@ -26,16 +26,42 @@
 event;%0A%0A
+import java.util.Objects;%0A
 import j
@@ -371,39 +371,8 @@
 ) %7B%0A
-%09%09this.id = UUID.randomUUID();%0A
 %09%09th
@@ -469,221 +469,919 @@
 lic 
-UUID getId() %7B%0A%09%09return id;%0A%09%7D%0A%0A%09public String getName() %7B%0A%09%09return name;%0A%09%7D%0A%0A%09public String getFirstName() %7B%0A%09%09return firstName;%0A%09%7D%0A%0A%09public String getSex() %7B%0A%09%09return sex;%0A%09%7D%0A%0A%09public int getAge() %7B%0A%09%09return age
+Person(UUID id, String name, String firstName, String sex, int age) %7B%0A%09%09this.id = id;%0A%09%09this.name = name;%0A%09%09this.firstName = firstName;%0A%09%09this.sex = sex;%0A%09%09this.age = age;%0A%09%7D%0A%0A%09public void setId(UUID id) %7B%0A%09%09this.id = id;%0A%09%7D%0A%0A%09public void setName(String name) %7B%0A%09%09this.name = name;%0A%09%7D%0A%0A%09public void setFirstName(String firstName) %7B%0A%09%09this.firstName = firstName;%0A%09%7D%0A%0A%09public void setSex(String sex) %7B%0A%09%09this.sex = sex;%0A%09%7D%0A%0A%09public void setAge(int age) %7B%0A%09%09this.age = age;%0A%09%7D%0A%0A%09public UUID getId() %7B%0A%09%09return id;%0A%09%7D%0A%0A%09public String getName() %7B%0A%09%09return name;%0A%09%7D%0A%0A%09public String getFirstName() %7B%0A%09%09return firstName;%0A%09%7D%0A%0A%09public String getSex() %7B%0A%09%09return sex;%0A%09%7D%0A%0A%09public int getAge() %7B%0A%09%09return age;%0A%09%7D%0A%0A%09@Override%0A%09public int hashCode() %7B%0A%09%09return Objects.hash(getId(), getName(), getFirstName(), getSex(), getAge());%0A%09%7D%0A%0A%09@Override%0A%09public boolean equals(Object obj) %7B%0A%09%09return this.hashCode() == obj.hashCode()
 ;%0A%09%7D

add hashCode equals method