]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/GenBuild/org/tianocore/build/fpd/FpdModuleIdentification.java
Initial import.
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / fpd / 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.build.fpd;
15
16 /**
17 This class is used to identify a module with BaseName, GUID, Version, PackageName
18 and ARCH.
19
20 @since GenBuild 1.0
21 **/
22 public class FpdModuleIdentification {
23
24 private String arch;
25
26 private String fvBinding;
27
28 private String baseName;
29
30 private String packageName;
31
32 private String guid;
33
34 private String version;
35
36 private String sequence;
37
38 /**
39
40 @param baseName the base name of the module
41 @param guid the GUID of the module
42 @param arch the ARCH of the module
43 **/
44 public FpdModuleIdentification(String baseName, String guid, String arch){
45 this.baseName = baseName;
46 this.guid = guid;
47 this.arch = arch;
48 }
49
50 /**
51 Override java.lang.Object#equals.
52
53 <p>Currently, use BaseName and ARCH to identify a module. It will enhance
54 in the next version. </p>
55
56 @see java.lang.Object#equals(java.lang.Object)
57 **/
58 public boolean equals(Object obj) {
59 if (obj instanceof FpdModuleIdentification) {
60 FpdModuleIdentification moduleIdObj = (FpdModuleIdentification)obj;
61 if ( baseName.equalsIgnoreCase(moduleIdObj.baseName) && arch.equalsIgnoreCase(moduleIdObj.arch)) {
62 return true;
63 }
64 // TBD
65 return false;
66 }
67 else {
68 return super.equals(obj);
69 }
70 }
71
72 public void setArch(String arch) {
73 this.arch = arch;
74 }
75
76 public void setFvBinding(String fvBinding) {
77 this.fvBinding = fvBinding;
78 }
79
80 public void setSequence(String sequence) {
81 this.sequence = sequence;
82 }
83
84 public String toString(){
85 return arch + ":" + guid + "_" + baseName;
86 }
87
88 public void setBaseName(String baseName) {
89 this.baseName = baseName;
90 }
91
92 public void setGuid(String guid) {
93 this.guid = guid;
94 }
95
96 public void setPackageName(String packageName) {
97 this.packageName = packageName;
98 }
99
100 public void setVersion(String version) {
101 this.version = version;
102 }
103
104 public String getArch() {
105 return arch;
106 }
107
108 public String getBaseName() {
109 return baseName;
110 }
111
112 public String getFvBinding() {
113 return fvBinding;
114 }
115
116 public String getGuid() {
117 return guid;
118 }
119
120 public String getPackageName() {
121 return packageName;
122 }
123
124 public String getSequence() {
125 return sequence;
126 }
127
128 public String getVersion() {
129 return version;
130 }
131 }