]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/id/FpdModuleIdentification.java
b30c32264877accc89160db2d0d320728b059733
[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 public FpdModuleIdentification(String arch, String fvBinding, String sequence, ModuleIdentification module){
34 this.arch = arch;
35 this.fvBinding = fvBinding;
36 this.sequence = sequence;
37 this.module = module;
38 }
39
40 public FpdModuleIdentification(ModuleIdentification module, String arch){
41 this.arch = arch;
42 this.module = module;
43 }
44 /**
45 Override java.lang.Object#equals.
46
47 <p>Currently, use BaseName and ARCH to identify a module. It will enhance
48 in the next version. </p>
49
50 @see java.lang.Object#equals(java.lang.Object)
51 **/
52 public boolean equals(Object obj) {
53 if (obj instanceof FpdModuleIdentification) {
54 FpdModuleIdentification moduleIdObj = (FpdModuleIdentification)obj;
55 if ( module.equals(moduleIdObj.module) && arch.equalsIgnoreCase(moduleIdObj.arch)) {
56 return true;
57 }
58 return false;
59 }
60 else {
61 return super.equals(obj);
62 }
63 }
64
65 public void setFvBinding(String fvBinding) {
66 this.fvBinding = fvBinding;
67 }
68
69 public void setSequence(String sequence) {
70 this.sequence = sequence;
71 }
72
73 public String toString(){
74 return arch + ":" + module;
75 }
76
77 public String getFvBinding() {
78 return fvBinding;
79 }
80
81 public String getSequence() {
82 return sequence;
83 }
84
85 public ModuleIdentification getModule() {
86 return module;
87 }
88
89 public void setModule(ModuleIdentification module) {
90 this.module = module;
91 }
92
93 public String getArch() {
94 return arch;
95 }
96
97 public void setArch(String arch) {
98 this.arch = arch;
99 }
100
101 public int hashCode(){
102 return module.hashCode();
103 }
104 }