]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/Identification.java
Changed spelling to manifest
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / common / Identifications / Identification.java
index 3a8420ce297f1b1e2f54e40c8b73201f9e74be5d..03717b560baeaa6808139ee491494d6ea36cf863 100644 (file)
@@ -17,48 +17,64 @@ package org.tianocore.frameworkwizard.common.Identifications;
 \r
 public class Identification {\r
 \r
-       ///\r
-       /// Define class members\r
-       ///\r
+    ///\r
+    /// Define class members\r
+    ///\r
     private String name;\r
-    \r
+\r
     private String guid;\r
-    \r
+\r
     private String version;\r
-    \r
+\r
     private String path;\r
-    \r
+\r
     public Identification(String name, String guid, String version) {\r
         this.name = name;\r
         this.guid = guid;\r
         this.version = version;\r
     }\r
-    \r
+\r
     public Identification() {\r
-       \r
+\r
     }\r
-    \r
+\r
     public Identification(String name, String guid, String version, String path) {\r
-       this.name = name;\r
+        this.name = name;\r
         this.guid = guid;\r
         this.version = version;\r
         this.path = path;\r
     }\r
-    \r
+\r
     public boolean equals(Object obj) {\r
         if (obj instanceof Identification) {\r
-            Identification id = (Identification)obj;\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
+        } else {\r
+            return super.equals(obj);\r
         }\r
-        else {\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
+                } else if (version.trim().equalsIgnoreCase("") || id.version.trim().equalsIgnoreCase("")) {\r
+                    return true;\r
+                } else if (version.equalsIgnoreCase(id.version)) {\r
+                    return true;\r
+                }\r
+            }\r
+            return false;\r
+        } else {\r
             return super.equals(obj);\r
         }\r
     }\r
-    \r
+\r
     public void setName(String name) {\r
         this.name = name;\r
     }\r
@@ -70,10 +86,10 @@ public class Identification {
     public void setVersion(String version) {\r
         this.version = version;\r
     }\r
-    \r
-       public void setPath(String path) {\r
-               this.path = path;\r
-       }\r
+\r
+    public void setPath(String path) {\r
+        this.path = path;\r
+    }\r
 \r
     public String getGuid() {\r
         return guid;\r
@@ -87,7 +103,11 @@ public class Identification {
         return version;\r
     }\r
 \r
-       public String getPath() {\r
-               return path;\r
-       }\r
+    public String getPath() {\r
+        return path;\r
+    }\r
+\r
+    public int hashCode() {\r
+        return guid.toLowerCase().hashCode();\r
+    }\r
 }\r