]>
Commit | Line | Data |
---|---|---|
a13899c5 | 1 | /** @file\r |
2 | Java class FpdModuleIdentification is used to present a module identification\r | |
3 | from BaseName, GUID, Version, PackageName, and ARCH. \r | |
4 | \r | |
5 | Copyright (c) 2006, Intel Corporation\r | |
6 | All rights reserved. This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | **/\r | |
14 | package org.tianocore.frameworkwizard.platform.ui.id;\r | |
15 | \r | |
16 | \r | |
17 | /**\r | |
18 | This class is used to identify a module with BaseName, GUID, Version, PackageName\r | |
19 | and ARCH.\r | |
20 | \r | |
21 | @since GenBuild 1.0\r | |
22 | **/\r | |
23 | public class FpdModuleIdentification {\r | |
24 | \r | |
25 | private String arch;\r | |
26 | \r | |
27 | private String fvBinding = "NULL"; // Optional\r | |
28 | \r | |
29 | private String sequence = "0"; // Optional\r | |
30 | \r | |
31 | private ModuleIdentification module;\r | |
32 | \r | |
a13899c5 | 33 | public FpdModuleIdentification(String arch, String fvBinding, String sequence, ModuleIdentification module){\r |
34 | this.arch = arch;\r | |
35 | this.fvBinding = fvBinding;\r | |
36 | this.sequence = sequence;\r | |
37 | this.module = module;\r | |
38 | }\r | |
39 | \r | |
40 | public FpdModuleIdentification(ModuleIdentification module, String arch){\r | |
41 | this.arch = arch;\r | |
42 | this.module = module;\r | |
43 | }\r | |
44 | /**\r | |
45 | Override java.lang.Object#equals. \r | |
46 | \r | |
47 | <p>Currently, use BaseName and ARCH to identify a module. It will enhance\r | |
48 | in the next version. </p>\r | |
49 | \r | |
50 | @see java.lang.Object#equals(java.lang.Object)\r | |
51 | **/\r | |
52 | public boolean equals(Object obj) {\r | |
53 | if (obj instanceof FpdModuleIdentification) {\r | |
54 | FpdModuleIdentification moduleIdObj = (FpdModuleIdentification)obj;\r | |
55 | if ( module.equals(moduleIdObj.module) && arch.equalsIgnoreCase(moduleIdObj.arch)) {\r | |
56 | return true;\r | |
57 | }\r | |
58 | return false;\r | |
59 | }\r | |
60 | else {\r | |
61 | return super.equals(obj);\r | |
62 | }\r | |
63 | }\r | |
64 | \r | |
65 | public void setFvBinding(String fvBinding) {\r | |
66 | this.fvBinding = fvBinding;\r | |
67 | }\r | |
68 | \r | |
69 | public void setSequence(String sequence) {\r | |
70 | this.sequence = sequence;\r | |
71 | }\r | |
72 | \r | |
73 | public String toString(){\r | |
74 | return arch + ":" + module;\r | |
75 | }\r | |
76 | \r | |
77 | public String getFvBinding() {\r | |
78 | return fvBinding;\r | |
79 | }\r | |
80 | \r | |
81 | public String getSequence() {\r | |
82 | return sequence;\r | |
83 | }\r | |
84 | \r | |
85 | public ModuleIdentification getModule() {\r | |
86 | return module;\r | |
87 | }\r | |
88 | \r | |
89 | public void setModule(ModuleIdentification module) {\r | |
90 | this.module = module;\r | |
91 | }\r | |
92 | \r | |
93 | public String getArch() {\r | |
94 | return arch;\r | |
95 | }\r | |
96 | \r | |
97 | public void setArch(String arch) {\r | |
98 | this.arch = arch;\r | |
99 | }\r | |
100 | \r | |
101 | public int hashCode(){\r | |
102 | return module.hashCode();\r | |
103 | }\r | |
104 | }\r |