BaseData.java

00001 /*
00002  * OpenMobileIS - a free Java(TM) Framework for mobile applications Java(TM)
00003  * Copyright (C) 2004-2006 Philippe Delrieu
00004  * All rights reserved.
00005  * Contact: pdelrieu@openmobileis.org
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00020  * USA
00021  *
00022  *  Author : Philippe Delrieu
00023  * 
00024  */
00025 package org.openmobileis.examples.simpleappli.data;
00026 
00027 import org.openmobileis.common.util.OpenMISSerializable;
00028 import org.openmobileis.examples.mycrm.data.Account;
00029 
00041 public final class BaseData implements OpenMISSerializable {
00042   //add serial version to avoid serialization error if the version change
00043   // without class change. 
00044   static final long serialVersionUID = 5521257935120563452L;
00045   
00046   private String id;
00047   private String data;
00048 
00052   public BaseData() {
00053     super();
00054   }
00055 
00059   public BaseData(String id) {
00060     super();
00061     this.id = id;
00062   }
00063 
00064   public String getData() {
00065     return data;
00066   }
00067 
00068   public void setData(String data) {
00069     this.data = data;
00070   }
00071 
00072   public String getId() {
00073     return id;
00074   }
00075 
00076   public void setId(String id) {
00077     this.id = id;
00078   }
00079   
00080   public boolean equals(Object obj)   {
00081       if (this.id.equals(((BaseData)obj).id))    {
00082           return true;
00083       }
00084       return false;
00085   }
00086   
00087   public int hashCode()   {
00088       return this.id.hashCode();
00089   }
00090 
00091 }

Generated on Mon Dec 4 11:03:25 2006 for OpenMobileIS by  doxygen 1.5.1-p1