]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/Identification.java
Changed spelling to manifest
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / common / Identifications / Identification.java
1 /** @file
2
3 The file is used to save basic information
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 **/
15
16 package org.tianocore.frameworkwizard.common.Identifications;
17
18 public class Identification {
19
20 ///
21 /// Define class members
22 ///
23 private String name;
24
25 private String guid;
26
27 private String version;
28
29 private String path;
30
31 public Identification(String name, String guid, String version) {
32 this.name = name;
33 this.guid = guid;
34 this.version = version;
35 }
36
37 public Identification() {
38
39 }
40
41 public Identification(String name, String guid, String version, String path) {
42 this.name = name;
43 this.guid = guid;
44 this.version = version;
45 this.path = path;
46 }
47
48 public boolean equals(Object obj) {
49 if (obj instanceof Identification) {
50 Identification id = (Identification) obj;
51 if (path.equals(id.path)) {
52 return true;
53 }
54 return false;
55 } else {
56 return super.equals(obj);
57 }
58 }
59
60 public boolean equalsWithGuid(Object obj) {
61 if (obj instanceof Identification) {
62 Identification id = (Identification) obj;
63 if (guid.equalsIgnoreCase(id.guid)) {
64 if (version == null || id.version == null) {
65 return true;
66 } else if (version.trim().equalsIgnoreCase("") || id.version.trim().equalsIgnoreCase("")) {
67 return true;
68 } else if (version.equalsIgnoreCase(id.version)) {
69 return true;
70 }
71 }
72 return false;
73 } else {
74 return super.equals(obj);
75 }
76 }
77
78 public void setName(String name) {
79 this.name = name;
80 }
81
82 public void setGuid(String guid) {
83 this.guid = guid;
84 }
85
86 public void setVersion(String version) {
87 this.version = version;
88 }
89
90 public void setPath(String path) {
91 this.path = path;
92 }
93
94 public String getGuid() {
95 return guid;
96 }
97
98 public String getName() {
99 return name;
100 }
101
102 public String getVersion() {
103 return version;
104 }
105
106 public String getPath() {
107 return path;
108 }
109
110 public int hashCode() {
111 return guid.toLowerCase().hashCode();
112 }
113 }