mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-18 07:14:09 +01:00
added equals, hashcode, and tostring
Former-commit-id: d29f3d164d55448bf8a38ef73f2071f44b67a865
This commit is contained in:
@@ -82,4 +82,51 @@ public class License {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generated hashCode implementation.
|
||||||
|
*
|
||||||
|
* @return the hash code
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = 7;
|
||||||
|
hash = 89 * hash + (this.url != null ? this.url.hashCode() : 0);
|
||||||
|
hash = 89 * hash + (this.name != null ? this.name.hashCode() : 0);
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generated equals method to perform equality check.
|
||||||
|
*
|
||||||
|
* @param obj the object to check
|
||||||
|
* @return true if the objects are equal; otherwise false
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (obj == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (getClass() != obj.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final License other = (License) obj;
|
||||||
|
if ((this.url == null) ? (other.url != null) : !this.url.equals(other.url)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generated toString.
|
||||||
|
*
|
||||||
|
* @return the string representation of the license
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "License{" + "url=" + url + ", name=" + name + '}';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user