From cb734e3049997ec9e4ade4e75c056fb049e2399b Mon Sep 17 00:00:00 2001 From: Carl Mastrangelo Date: Wed, 26 Aug 2015 13:10:13 -0700 Subject: [PATCH] Document equals and hashCode on Status --- core/src/main/java/io/grpc/Status.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/core/src/main/java/io/grpc/Status.java b/core/src/main/java/io/grpc/Status.java index 37208fbbd5..96d6b297e9 100644 --- a/core/src/main/java/io/grpc/Status.java +++ b/core/src/main/java/io/grpc/Status.java @@ -459,4 +459,24 @@ public final class Status { return fromCodeValue(Integer.valueOf(serialized)); } } + + /** + * Equality on Statuses is not well defined. Instead, do comparison based on their Code with + * {@link #getCode}. The description and cause of the Status are unlikely to be stable, and + * additional fields may be added to Status in the future. + */ + @Override + public boolean equals(Object obj) { + return super.equals(obj); + } + + /** + * Hash codes on Statuses are not well defined. + * + * @see #equals + */ + @Override + public int hashCode() { + return super.hashCode(); + } }