]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/GenBuild/org/tianocore/build/id/Identification.java
abf5c1bade3aec2108da3d5286e1f5847255f481
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / id / Identification.java
1 package org.tianocore.build.id;
2
3 import org.tianocore.build.global.GlobalData;
4
5 public class Identification {
6
7 String name;
8
9 String guid;
10
11 String version;
12
13 String type; // Optional
14
15 Identification(String name, String guid, String version){
16 this.name = name;
17 this.guid = guid;
18 this.version = version;
19 }
20
21 Identification(String guid, String version){
22 this.guid = guid;
23 this.version = version;
24 }
25
26 public boolean equals(Object obj) {
27 if (obj instanceof Identification) {
28 Identification id = (Identification)obj;
29 if ( guid.equalsIgnoreCase(id.guid)) {
30 if (version == null || id.version == null) {
31 return true;
32 }
33 else if (version.trim().equalsIgnoreCase("") || id.version.trim().equalsIgnoreCase("")){
34 return true;
35 }
36 else if (version.equalsIgnoreCase(id.version)) {
37 return true;
38 }
39 }
40 return false;
41 }
42 else {
43 return super.equals(obj);
44 }
45 }
46
47 public void setName(String name) {
48 this.name = name;
49 }
50
51 public void setGuid(String guid) {
52 this.guid = guid;
53 }
54
55 public void setVersion(String version) {
56 this.version = version;
57 }
58
59 public String getGuid() {
60 return guid;
61 }
62
63 public String getName() {
64 return name;
65 }
66
67 public String getVersion() {
68 return version;
69 }
70
71 public int hashCode(){
72 return guid.toLowerCase().hashCode();
73 }
74 }