1 package org
.tianocore
.build
.id
;
5 import org
.tianocore
.build
.global
.GlobalData
;
7 public class ModuleIdentification
extends Identification
{
9 private PackageIdentification packageId
;
13 private String moduleType
;
15 private boolean isLibrary
= false;
17 public ModuleIdentification(String guid
, String version
){
21 public ModuleIdentification(String guid
, String version
, PackageIdentification packageId
){
23 this.packageId
= packageId
;
26 public ModuleIdentification(String name
, String guid
, String version
){
27 super(name
, guid
, version
);
30 public ModuleIdentification(String name
, String guid
, String version
, PackageIdentification packageId
){
31 super(name
, guid
, version
);
32 this.packageId
= packageId
;
35 public boolean isLibrary() {
39 public void setLibrary(boolean isLibrary
) {
40 this.isLibrary
= isLibrary
;
43 public File
getMsaFile() {
48 public String
getModuleRelativePath() {
50 if (msaFile
.getParent().length() == packageId
.getPackageDir().length()) {
53 return msaFile
.getParent().substring(packageId
.getPackageDir().length() + 1);
56 private void prepareMsaFile(){
57 if (msaFile
== null) {
58 GlobalData
.refreshModuleIdentification(this);
62 public void setMsaFile(File msaFile
) {
63 this.msaFile
= msaFile
;
66 public boolean equals(Object obj
) {
67 if (obj
instanceof ModuleIdentification
) {
68 ModuleIdentification id
= (ModuleIdentification
)obj
;
69 if (guid
.equalsIgnoreCase(id
.getGuid()) && packageId
.equals(id
.getPackage())) {
70 if (version
== null || id
.version
== null) {
73 else if (version
.trim().equalsIgnoreCase("") || id
.version
.trim().equalsIgnoreCase("")){
76 else if (version
.equalsIgnoreCase(id
.version
)) {
83 return super.equals(obj
);
87 public String
toString(){
89 GlobalData
.refreshModuleIdentification(this);
91 if (version
== null || version
.trim().equalsIgnoreCase("")) {
92 return "Module [" + name
+ "] in " + packageId
;
95 return "Module [" + name
+ " " + version
+ "] in " + packageId
;
99 public void setPackage(PackageIdentification packageId
) {
100 this.packageId
= packageId
;
103 public PackageIdentification
getPackage() {
107 public String
getModuleType() {
108 if (moduleType
== null) {
109 GlobalData
.refreshModuleIdentification(this);
114 public void setModuleType(String moduleType
) {
115 this.moduleType
= moduleType
;
118 public String
getName() {
120 GlobalData
.refreshModuleIdentification(this);