]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/Identification.java
1. Enhance Source Files selection in msa:
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / common / Identifications / Identification.java
CommitLineData
79cb6fdb 1/** @file\r
2 \r
3 The file is used to save basic information\r
4 \r
5 Copyright (c) 2006, Intel Corporation\r
6 All rights reserved. This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10 \r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13 \r
14 **/\r
15\r
16package org.tianocore.frameworkwizard.common.Identifications;\r
17\r
18public class Identification {\r
19\r
2003a22e 20 ///\r
21 /// Define class members\r
22 ///\r
79cb6fdb 23 private String name;\r
2003a22e 24\r
79cb6fdb 25 private String guid;\r
2003a22e 26\r
79cb6fdb 27 private String version;\r
2003a22e 28\r
79cb6fdb 29 private String path;\r
2003a22e 30\r
79cb6fdb 31 public Identification(String name, String guid, String version) {\r
32 this.name = name;\r
33 this.guid = guid;\r
34 this.version = version;\r
35 }\r
2003a22e 36\r
79cb6fdb 37 public Identification() {\r
2003a22e 38\r
79cb6fdb 39 }\r
2003a22e 40\r
79cb6fdb 41 public Identification(String name, String guid, String version, String path) {\r
2003a22e 42 this.name = name;\r
79cb6fdb 43 this.guid = guid;\r
44 this.version = version;\r
45 this.path = path;\r
46 }\r
2003a22e 47\r
79cb6fdb 48 public boolean equals(Object obj) {\r
2003a22e 49 if (obj instanceof Identification) {\r
50 Identification id = (Identification) obj;\r
51 if (path.equals(id.path)) {\r
52 //if ( name.equals(id.name) && guid.equals(id.guid) && version.equals(id.version)) {\r
53 return true;\r
54 }\r
55 return false;\r
56 } else {\r
57 return super.equals(obj);\r
58 }\r
59 }\r
60\r
5a24e806 61 public boolean equalsWithGuid(Object obj) {\r
2003a22e 62 if (obj instanceof Identification) {\r
63 Identification id = (Identification) obj;\r
64 if (guid.equalsIgnoreCase(id.guid)) {\r
65 if (version == null || id.version == null) {\r
66 return true;\r
67 } else if (version.trim().equalsIgnoreCase("") || id.version.trim().equalsIgnoreCase("")) {\r
68 return true;\r
69 } else if (version.equalsIgnoreCase(id.version)) {\r
70 return true;\r
71 }\r
72 }\r
73 return false;\r
74 } else {\r
75 return super.equals(obj);\r
76 }\r
77 }\r
78\r
79cb6fdb 79 public void setName(String name) {\r
80 this.name = name;\r
81 }\r
82\r
83 public void setGuid(String guid) {\r
84 this.guid = guid;\r
85 }\r
86\r
87 public void setVersion(String version) {\r
88 this.version = version;\r
89 }\r
2003a22e 90\r
91 public void setPath(String path) {\r
92 this.path = path;\r
93 }\r
79cb6fdb 94\r
95 public String getGuid() {\r
96 return guid;\r
97 }\r
98\r
99 public String getName() {\r
100 return name;\r
101 }\r
102\r
103 public String getVersion() {\r
104 return version;\r
105 }\r
106\r
2003a22e 107 public String getPath() {\r
108 return path;\r
109 }\r
110\r
111 public int hashCode() {\r
112 return guid.toLowerCase().hashCode();\r
113 }\r
79cb6fdb 114}\r