MCPcopy Index your code
hub / github.com/grpc/grpc-java / equals

Method equals

api/src/main/java/io/grpc/StatusOr.java:77–90  ·  view source on GitHub ↗

Note that StatusOr containing statuses, the equality comparision is delegated to Status#equals which just does a reference equality check because equality on Statuses is not well defined. Instead, do comparison based on their Code with Status#getCode. The description and cause of th

(Object other)

Source from the content-addressed store, hash-verified

75 * in the future.
76 */
77 @Override
78 public boolean equals(Object other) {
79 if (!(other instanceof StatusOr)) {
80 return false;
81 }
82 StatusOr<?> otherStatus = (StatusOr<?>) other;
83 if (hasValue() != otherStatus.hasValue()) {
84 return false;
85 }
86 if (hasValue()) {
87 return Objects.equal(value, otherStatus.value);
88 }
89 return Objects.equal(status, otherStatus.status);
90 }
91
92 @Override
93 public int hashCode() {

Callers

nothing calls this directly

Calls 2

hasValueMethod · 0.95
equalMethod · 0.45

Tested by

no test coverage detected