Introduce equals/hashCode methods for RequestedSecret.

Closes gh-103
This commit is contained in:
Mark Paluch
2017-06-04 15:09:40 +02:00
parent d9f53150e2
commit 4edcbc7c77
2 changed files with 26 additions and 1 deletions

View File

@@ -107,6 +107,7 @@ public class Lease {
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (!(o instanceof Lease))

View File

@@ -97,9 +97,33 @@ public class RequestedSecret {
return mode;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (!(o instanceof RequestedSecret))
return false;
RequestedSecret that = (RequestedSecret) o;
if (!path.equals(that.path))
return false;
return mode == that.mode;
}
@Override
public int hashCode() {
int result = path.hashCode();
result = 31 * result + mode.hashCode();
return result;
}
@Override
public String toString() {
final StringBuffer sb = new StringBuffer();
StringBuffer sb = new StringBuffer();
sb.append(getClass().getSimpleName());
sb.append(" [path='").append(path).append('\'');
sb.append(", mode=").append(mode);