]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/Java/Source/GenBuild/org/tianocore/build/id/Identification.java
2 This file is to define Identification class.
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 package org
.tianocore
.build
.id
;
18 This class is used to identify with its GUID and Version.
22 public class Identification
{
33 @param version Version
35 Identification(String name
, String guid
, String version
){
38 this.version
= version
;
43 @param version Version
45 Identification(String guid
, String version
){
47 this.version
= version
;
51 @see java.lang.Object#equals(java.lang.Object)
53 public boolean equals(Object obj
) {
54 if (obj
instanceof Identification
) {
55 Identification id
= (Identification
)obj
;
56 if ( guid
.equalsIgnoreCase(id
.guid
)) {
57 if (version
== null || id
.version
== null) {
60 else if (version
.trim().equalsIgnoreCase("") || id
.version
.trim().equalsIgnoreCase("")){
63 else if (version
.equalsIgnoreCase(id
.version
)) {
70 return super.equals(obj
);
77 public void setName(String name
) {
84 public void setGuid(String guid
) {
89 @param version Version
91 public void setVersion(String version
) {
92 this.version
= version
;
95 public String
getGuid() {
102 public String
getName() {
107 @return String Version
109 public String
getVersion() {
113 public String
toGuidString() {
114 if (version
== null || version
.trim().equalsIgnoreCase("")) {
115 return "[" + guid
+ "]";
118 return "[" + guid
+ "] and version [" + version
+ "]";
123 @see java.lang.Object#hashCode()
125 public int hashCode(){
126 return guid
.toLowerCase().hashCode();