]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/Identification.java
1. Support to Create/Update/Delete/Install far file
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / common / Identifications / Identification.java
index 3a8420ce297f1b1e2f54e40c8b73201f9e74be5d..4affb03afec9d537c8cbb48b8a66a118eff5d493 100644 (file)
@@ -46,18 +46,39 @@ public class Identification {
     }\r
     \r
     public boolean equals(Object obj) {\r
-        if (obj instanceof Identification) {\r
-            Identification id = (Identification)obj;\r
-            if (path.equals(id.path)) {\r
-            //if ( name.equals(id.name) && guid.equals(id.guid) && version.equals(id.version)) {\r
-                return true;\r
-            }\r
-            return false;\r
-        }\r
-        else {\r
-            return super.equals(obj);\r
-        }\r
-    }\r
+      if (obj instanceof Identification) {\r
+          Identification id = (Identification)obj;\r
+          if (path.equals(id.path)) {\r
+          //if ( name.equals(id.name) && guid.equals(id.guid) && version.equals(id.version)) {\r
+              return true;\r
+          }\r
+          return false;\r
+      }\r
+      else {\r
+          return super.equals(obj);\r
+      }\r
+  }\r
+    \r
+    public boolean equalsWithGuid(Object obj) {\r
+      if (obj instanceof Identification) {\r
+          Identification id = (Identification)obj;\r
+          if ( guid.equalsIgnoreCase(id.guid)) {\r
+              if (version == null || id.version == null) {\r
+                  return true;\r
+              }\r
+              else if (version.trim().equalsIgnoreCase("") || id.version.trim().equalsIgnoreCase("")){\r
+                  return true;\r
+              }\r
+              else if (version.equalsIgnoreCase(id.version)) {\r
+                  return true;\r
+              }\r
+          }\r
+          return false;\r
+      }\r
+      else {\r
+          return super.equals(obj);\r
+      }\r
+   }\r
     \r
     public void setName(String name) {\r
         this.name = name;\r
@@ -90,4 +111,8 @@ public class Identification {
        public String getPath() {\r
                return path;\r
        }\r
\r
+ public int hashCode(){\r
+   return guid.toLowerCase().hashCode();\r
+ }\r
 }\r