00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 package org.openmobileis.common.user.profile;
00027
00028 import org.openmobileis.common.util.OpenMISSerializable;
00029
00034 public final class ProfileProperty implements OpenMISSerializable {
00035 static final long serialVersionUID = 5521257935120563452L;
00039 public String key;
00040
00044 public String value;
00045
00049 public String moduleName;
00050
00054 public ProfileProperty() { }
00055
00061 public ProfileProperty(String key, String value) {
00062 this.key = key;
00063 this.value = value;
00064 }
00065
00066 public boolean equals(Object obj) {
00067 if (obj instanceof ProfileProperty) {
00068 ProfileProperty nobj = (ProfileProperty) obj;
00069 if (nobj.key.equals(this.key) && nobj.value.equals(this.value)) {
00070
00071 if (nobj.moduleName != null && this.moduleName == null) {
00072 return false;
00073 } else if (nobj.moduleName == null && this.moduleName != null) {
00074 return false;
00075 } else if (nobj.moduleName != null && this.moduleName != null) {
00076 if (!nobj.moduleName.equals(this.moduleName)) {
00077 return false;
00078 }
00079 }
00080 return true;
00081 }
00082 }
00083 return false;
00084 }
00085
00086 public int hashCode() {
00087 StringBuffer buff = new StringBuffer(this.key);
00088 buff.append("/");
00089 buff.append(this.value);
00090 if (this.moduleName != null) {
00091 buff.append(":");
00092 buff.append(this.moduleName);
00093 }
00094 return buff.hashCode();
00095 }
00096
00097 }