summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/certsrv/property
diff options
context:
space:
mode:
Diffstat (limited to 'base/common/src/com/netscape/certsrv/property')
-rw-r--r--base/common/src/com/netscape/certsrv/property/Descriptor.java43
1 files changed, 43 insertions, 0 deletions
diff --git a/base/common/src/com/netscape/certsrv/property/Descriptor.java b/base/common/src/com/netscape/certsrv/property/Descriptor.java
index f5069d046..63e154466 100644
--- a/base/common/src/com/netscape/certsrv/property/Descriptor.java
+++ b/base/common/src/com/netscape/certsrv/property/Descriptor.java
@@ -115,4 +115,47 @@ public class Descriptor implements IDescriptor {
return "Descriptor [mSyntax=" + mSyntax + ", mConstraint=" + mConstraint + ", mDescription=" + mDescription
+ ", mDef=" + mDef + "]";
}
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((mConstraint == null) ? 0 : mConstraint.hashCode());
+ result = prime * result + ((mDef == null) ? 0 : mDef.hashCode());
+ result = prime * result + ((mDescription == null) ? 0 : mDescription.hashCode());
+ result = prime * result + ((mSyntax == null) ? 0 : mSyntax.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Descriptor other = (Descriptor) obj;
+ if (mConstraint == null) {
+ if (other.mConstraint != null)
+ return false;
+ } else if (!mConstraint.equals(other.mConstraint))
+ return false;
+ if (mDef == null) {
+ if (other.mDef != null)
+ return false;
+ } else if (!mDef.equals(other.mDef))
+ return false;
+ if (mDescription == null) {
+ if (other.mDescription != null)
+ return false;
+ } else if (!mDescription.equals(other.mDescription))
+ return false;
+ if (mSyntax == null) {
+ if (other.mSyntax != null)
+ return false;
+ } else if (!mSyntax.equals(other.mSyntax))
+ return false;
+ return true;
+ }
}