/*******************************************************************************
*
* Copyright (c) 2013 GigaSpaces Technologies Ltd. All rights reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************/
package org.openspaces.itest.persistency.common.data;
import java.io.Serializable;
import java.util.UUID;
public class TestPojo2 implements Serializable {
private static final long serialVersionUID = 1L;
private String name;
private Integer age;
private UUID uuid;
public TestPojo2() { }
public TestPojo2(String name, int age) {
this.name = name;
this.age = age;
this.uuid = UUID.randomUUID();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public UUID getUuid() {
return uuid;
}
public void setUuid(UUID uuid) {
this.uuid = uuid;
}
@Override
public String toString() {
return "TestPojo2 [name=" + name + ", age=" + age + ", uuid=" + uuid + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((age == null) ? 0 : age.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((uuid == null) ? 0 : uuid.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
TestPojo2 other = (TestPojo2) obj;
if (age == null)
{
if (other.age != null)
return false;
}
else
if (!age.equals(other.age))
return false;
if (name == null)
{
if (other.name != null)
return false;
}
else
if (!name.equals(other.name))
return false;
if (uuid == null)
{
if (other.uuid != null)
return false;
}
else
if (!uuid.equals(other.uuid))
return false;
return true;
}
}