package org.jboss.cache.loader;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Bela Ban
 * @version $Id: SamplePojo.java,v 1.2 2005/07/24 00:06:21 msurtani Exp $
 */
public class SamplePojo implements Serializable {
   int age;
   String name;
   List hobbies=new ArrayList();

   public SamplePojo(int age, String name) {
      this.age=age;
      this.name=name;
   }

   public int getAge() {
      return age;
   }

   public void setAge(int age) {
      this.age=age;
   }

   public String getName() {
      return name;
   }

   public void setName(String name) {
      this.name=name;
   }

   public List getHobbies() {
      return hobbies;
   }

   public void setHobbies(List hobbies) {
      this.hobbies=hobbies;
   }

   public String toString() {
      return "name=" + name + ", age=" + age + ", hobbies=" + hobbies;
   }

   public boolean equals(Object o)
   {
       if (o instanceof SamplePojo)
       {
           SamplePojo other = (SamplePojo) o;
           boolean equals = (name.equals(other.getName())) && (age == other.getAge()) && (hobbies.equals(other.getHobbies()));
           return equals;
       }
       else
           return false;
   }
}
