]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/Identification.java
Add some comments for translator parameter in Sync/AsyncInterruptTransfer.
[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 //if ( name.equals(id.name) && guid.equals(id.guid) && version.equals(id.version)) {
53 return true;
54 }
55 return false;
56 }
57 else {
58 return super.equals(obj);
59 }
60 }
61
62 public boolean equalsWithGuid(Object obj) {
63 if (obj instanceof Identification) {
64 Identification id = (Identification)obj;
65 if ( guid.equalsIgnoreCase(id.guid)) {
66 if (version == null || id.version == null) {
67 return true;
68 }
69 else if (version.trim().equalsIgnoreCase("") || id.version.trim().equalsIgnoreCase("")){
70 return true;
71 }
72 else if (version.equalsIgnoreCase(id.version)) {
73 return true;
74 }
75 }
76 return false;
77 }
78 else {
79 return super.equals(obj);
80 }
81 }
82
83 public void setName(String name) {
84 this.name = name;
85 }
86
87 public void setGuid(String guid) {
88 this.guid = guid;
89 }
90
91 public void setVersion(String version) {
92 this.version = version;
93 }
94
95 public void setPath(String path) {
96 this.path = path;
97 }
98
99 public String getGuid() {
100 return guid;
101 }
102
103 public String getName() {
104 return name;
105 }
106
107 public String getVersion() {
108 return version;
109 }
110
111 public String getPath() {
112 return path;
113 }
114
115 public int hashCode(){
116 return guid.toLowerCase().hashCode();
117 }
118 }