]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/Identification.java
1. Support to Create/Update/Delete/Install far file
[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
20 ///\r
21 /// Define class members\r
22 ///\r
23 private String name;\r
24 \r
25 private String guid;\r
26 \r
27 private String version;\r
28 \r
29 private String path;\r
30 \r
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
36 \r
37 public Identification() {\r
38 \r
39 }\r
40 \r
41 public Identification(String name, String guid, String version, String path) {\r
42 this.name = name;\r
43 this.guid = guid;\r
44 this.version = version;\r
45 this.path = path;\r
46 }\r
47 \r
48 public boolean equals(Object obj) {\r
5a24e806 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 }\r
57 else {\r
58 return super.equals(obj);\r
59 }\r
60 }\r
61 \r
62 public boolean equalsWithGuid(Object obj) {\r
63 if (obj instanceof Identification) {\r
64 Identification id = (Identification)obj;\r
65 if ( guid.equalsIgnoreCase(id.guid)) {\r
66 if (version == null || id.version == null) {\r
67 return true;\r
68 }\r
69 else if (version.trim().equalsIgnoreCase("") || id.version.trim().equalsIgnoreCase("")){\r
70 return true;\r
71 }\r
72 else if (version.equalsIgnoreCase(id.version)) {\r
73 return true;\r
74 }\r
75 }\r
76 return false;\r
77 }\r
78 else {\r
79 return super.equals(obj);\r
80 }\r
81 }\r
79cb6fdb 82 \r
83 public void setName(String name) {\r
84 this.name = name;\r
85 }\r
86\r
87 public void setGuid(String guid) {\r
88 this.guid = guid;\r
89 }\r
90\r
91 public void setVersion(String version) {\r
92 this.version = version;\r
93 }\r
94 \r
95 public void setPath(String path) {\r
96 this.path = path;\r
97 }\r
98\r
99 public String getGuid() {\r
100 return guid;\r
101 }\r
102\r
103 public String getName() {\r
104 return name;\r
105 }\r
106\r
107 public String getVersion() {\r
108 return version;\r
109 }\r
110\r
111 public String getPath() {\r
112 return path;\r
113 }\r
5a24e806 114 \r
115 public int hashCode(){\r
116 return guid.toLowerCase().hashCode();\r
117 }\r
79cb6fdb 118}\r