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