diff options
Diffstat (limited to 'auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CommandLineArgument.java')
-rw-r--r-- | auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CommandLineArgument.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CommandLineArgument.java b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CommandLineArgument.java index f1a6e7867..6dd2f14ee 100644 --- a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CommandLineArgument.java +++ b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CommandLineArgument.java @@ -141,4 +141,54 @@ public class CommandLineArgument implements Comparable<CommandLineArgument> { } return description.compareTo(otherArgument.description); } + + /* (non-Javadoc) + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((argumentName == null) ? 0 : argumentName.hashCode()); + result = prime * result + ((description == null) ? 0 : description.hashCode()); + result = prime * result + (nullable ? 1231 : 1237); + return result; + } + + /* (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + + if (obj == null) { + return false; + } + + if (getClass() != obj.getClass()) { + return false; + } + + CommandLineArgument other = (CommandLineArgument) obj; + if (argumentName == null) { + if (other.argumentName != null) { + return false; + } + } else if (!argumentName.equals(other.argumentName)) { + return false; + } + + if (description == null) { + if (other.description != null) { + return false; + } + } else if (!description.equals(other.description)) { + return false; + } + + return nullable == other.nullable; + } } |