1 package org.jboss.cache.loader; 2 3 import java.io.Serializable ; 4 import java.util.ArrayList ; 5 import java.util.List ; 6 7 11 public class SamplePojo implements Serializable { 12 int age; 13 String name; 14 List hobbies=new ArrayList (); 15 16 public SamplePojo(int age, String name) { 17 this.age=age; 18 this.name=name; 19 } 20 21 public int getAge() { 22 return age; 23 } 24 25 public void setAge(int age) { 26 this.age=age; 27 } 28 29 public String getName() { 30 return name; 31 } 32 33 public void setName(String name) { 34 this.name=name; 35 } 36 37 public List getHobbies() { 38 return hobbies; 39 } 40 41 public void setHobbies(List hobbies) { 42 this.hobbies=hobbies; 43 } 44 45 public String toString() { 46 return "name=" + name + ", age=" + age + ", hobbies=" + hobbies; 47 } 48 49 public boolean equals(Object o) 50 { 51 if (o instanceof SamplePojo) 52 { 53 SamplePojo other = (SamplePojo) o; 54 boolean equals = (name.equals(other.getName())) && (age == other.getAge()) && (hobbies.equals(other.getHobbies())); 55 return equals; 56 } 57 else 58 return false; 59 } 60 } 61 | Popular Tags |