--- /dev/null
+/** @file\r
+ Java class FpdModuleIdentification is used to present a module identification\r
+ from BaseName, GUID, Version, PackageName, and ARCH. \r
+ \r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+**/\r
+package org.tianocore.build.id;\r
+\r
+\r
+/**\r
+ This class is used to identify a module with BaseName, GUID, Version, PackageName\r
+ and ARCH.\r
+ \r
+ @since GenBuild 1.0\r
+ **/\r
+public class FpdModuleIdentification {\r
+ \r
+ private String arch;\r
+ \r
+ private String fvBinding = "NULL"; // Optional\r
+ \r
+ private String sequence = "0"; // Optional\r
+ \r
+ private ModuleIdentification module;\r
+ \r
+ private String target; // Optional\r
+ \r
+ private String toolchain; // Optional\r
+ \r
+ public FpdModuleIdentification(String arch, String fvBinding, String sequence, ModuleIdentification module){\r
+ this.arch = arch;\r
+ this.fvBinding = fvBinding;\r
+ this.sequence = sequence;\r
+ this.module = module;\r
+ }\r
+ \r
+ public FpdModuleIdentification(ModuleIdentification module, String arch){\r
+ this.arch = arch;\r
+ this.module = module;\r
+ }\r
+ /**\r
+ Override java.lang.Object#equals. \r
+ \r
+ <p>Currently, use BaseName and ARCH to identify a module. It will enhance\r
+ in the next version. </p>\r
+ \r
+ @see java.lang.Object#equals(java.lang.Object)\r
+ **/\r
+ public boolean equals(Object obj) {\r
+ if (obj instanceof FpdModuleIdentification) {\r
+ FpdModuleIdentification moduleIdObj = (FpdModuleIdentification)obj;\r
+ if ( module.equals(moduleIdObj.module) && arch.equalsIgnoreCase(moduleIdObj.arch)) {\r
+ return true;\r
+ }\r
+ return false;\r
+ }\r
+ else {\r
+ return false;\r
+ }\r
+ }\r
+\r
+ public void setFvBinding(String fvBinding) {\r
+ this.fvBinding = fvBinding;\r
+ }\r
+\r
+ public void setSequence(String sequence) {\r
+ this.sequence = sequence;\r
+ }\r
+\r
+ public String toString(){\r
+ return arch + ":" + module;\r
+ }\r
+\r
+ public String getFvBinding() {\r
+ return fvBinding;\r
+ }\r
+\r
+ public String getSequence() {\r
+ return sequence;\r
+ }\r
+\r
+ public ModuleIdentification getModule() {\r
+ return module;\r
+ }\r
+\r
+ public void setModule(ModuleIdentification module) {\r
+ this.module = module;\r
+ }\r
+\r
+ public String getArch() {\r
+ return arch;\r
+ }\r
+\r
+ public void setArch(String arch) {\r
+ this.arch = arch;\r
+ }\r
+ \r
+ public int hashCode(){\r
+ return module.hashCode();\r
+ }\r
+}\r