ProfileRubric.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 
00026 package org.openmobileis.common.user.profil;
00027 
00028 import org.openmobileis.common.util.OpenMISSerializable;
00029 
00034 public final class ProfileRubric implements OpenMISSerializable {
00035   static final long serialVersionUID = 5521257935120563452L;
00039     public String moduleName;
00040 
00044     public String rubricName;
00045 
00049     public String description;
00050 
00054     public String version;
00055 
00059     public ProfileRubric()  { }
00060 
00068     public ProfileRubric(String channelName, String rubricName, String description, ProfileProperty[] propertiesList)    {
00069         this.moduleName = channelName;
00070         this.rubricName = rubricName;
00071         this.description = description;
00072     }
00073     
00074     public boolean equals(Object obj) {
00075       if (obj instanceof ProfileRubric) {
00076         ProfileRubric nobj = (ProfileRubric) obj;
00077         if (nobj.moduleName.equals(this.moduleName) && nobj.rubricName.equals(this.rubricName))    {
00078           if (nobj.version != null && this.version == null) {
00079             return false;
00080           } else  if (nobj.version == null && this.version != null)  {
00081             return false;
00082           } else if (nobj.version != null && this.version != null) {
00083             if (!nobj.version.equals(this.version))  {
00084               return false;
00085             }
00086           }
00087           return true;
00088         }
00089       }
00090       return false;
00091     }
00092     
00093     public int hashCode() {
00094       StringBuffer buff = new StringBuffer(this.moduleName);
00095       buff.append("/");
00096       buff.append(this.rubricName);
00097       return buff.hashCode();
00098     }
00099 
00100 }

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