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 
00040 public final class BaseData implements OpenMISSerializable {
00041   //add serial version to avoid serialization error if the version change
00042   // without class change. 
00043   static final long serialVersionUID = 5521257935120563452L;
00044   
00045   private String id;
00046   private String data;
00047 
00051   public BaseData() {
00052     super();
00053   }
00054 
00058   public BaseData(String id) {
00059     super();
00060     this.id = id;
00061   }
00062 
00063   public String getData() {
00064     return data;
00065   }
00066 
00067   public void setData(String data) {
00068     this.data = data;
00069   }
00070 
00071   public String getId() {
00072     return id;
00073   }
00074 
00075   public void setId(String id) {
00076     this.id = id;
00077   }
00078   
00079   public boolean equals(Object obj)   {
00080       if (this.id.equals(((BaseData)obj).id))    {
00081           return true;
00082       }
00083       return false;
00084   }
00085   
00086   public int hashCode()   {
00087       return this.id.hashCode();
00088   }
00089 
00090 }

Generated on Mon Jan 11 21:19:13 2010 for OpenMobileIS by  doxygen 1.5.4